Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问clear审计通过

clerk-auth-expert文员 授权专家

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

306

周安装

13

GitHub Stars

1

下载量

107
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:clerk-auth-expert(文员 授权专家)
来源仓库:https://github.com/kelvincushman/n8ture-ai-app
仓库路径:skills/clerk-auth-expert
安装命令:
npx skills add https://github.com/kelvincushman/n8ture-ai-app --skill clerk-auth-expert
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/kelvincushman/n8ture-ai-app --skill clerk-auth-expert

简介

深度集成 Clerk SDK 到 React Native 或 Expo 应用,实现完整认证与安全流程。

  • 负责会话管理、令牌刷新、受保护路由与用户资料更新等企业级功能。
  • 遵循防御性编程原则,结合 HttpOnly cookies 与 CSRF 防护机制。
  • 需配置 ClerkProvider 并设置正确的 publishable key 与 secret key。
  • clerk-auth-expert 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Clerk Authentication Expert

You are a Clerk authentication expert with deep knowledge of the Clerk ecosystem for React Native and Expo applications. This skill enables you to implement secure, production-ready authentication flows for the N8ture AI App.

Core Responsibilities

  • Implement Clerk SDK - Set up @clerk/clerk-expo with proper configuration
  • Authentication flows - Build sign-in, sign-up, password reset, and social auth
  • Session management - Handle user sessions, token refresh, and persistence
  • Protected routes - Create authentication guards for navigation
  • User management - Access and update user profiles and metadata
  • Backend integration - Pass Clerk JWT tokens to Firebase Cloud Functions

Quick Start

Installation

npx expo install @clerk/clerk-expo expo-secure-store

Basic Setup

// App.js
import { ClerkProvider } from '@clerk/clerk-expo';
import * as SecureStore from 'expo-secure-store';

const tokenCache = {
  async getToken(key) {
    return SecureStore.getItemAsync(key);
  },
  async saveToken(key, value) {
    return SecureStore.setItemAsync(key, value);
  },
};

export default function App() {
  return (
    <ClerkProvider
      publishableKey={process.env.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY}
      tokenCache={tokenCache}
    >
      <RootNavigator />
    </ClerkProvider>
  );
}

Common Patterns

Protected Route

import { useAuth } from '@clerk/clerk-expo';

export function useProtectedRoute() {
  const { isSignedIn, isLoaded } = useAuth();
  const navigation = useNavigation();

  useEffect(() => {
    if (isLoaded && !isSignedIn) {
      navigation.navigate('SignIn');
    }
  }, [isSignedIn, isLoaded]);

  return { isSignedIn, isLoaded };
}

User Profile Access

import { useUser } from '@clerk/clerk-expo';

export function ProfileScreen() {
  const { user } = useUser();

  const updateProfile = async () => {
    await user.update({
      firstName: 'John',
      lastName: 'Doe',
    });
  };

  return (
    <View>
      <Text>Welcome, {user.firstName}!</Text>
      <Text>Email: {user.primaryEmailAddress.emailAddress}</Text>
    </View>
  );
}

Backend Token Passing

import { useAuth } from '@clerk/clerk-expo';

export function useAuthenticatedRequest() {
  const { getToken } = useAuth();

  const makeRequest = async (endpoint, data) => {
    const token = await getToken();

    const response = await fetch(endpoint, {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify(data),
    });

    return response.json();
  };

  return { makeRequest };
}

N8ture AI App Integration

Trial Management

Store user trial count in Clerk user metadata:

// Update trial count
await user.update({
  unsafeMetadata: {
    trialCount: 3,
    totalIdentifications: 0,
  },
});

// Check trial status
const trialCount = user.unsafeMetadata.trialCount || 0;
const canIdentify = user.publicMetadata.isPremium || trialCount > 0;

Premium Subscription Status

// Store subscription status
await user.update({
  publicMetadata: {
    isPremium: true,
    subscriptionId: 'sub_xxx',
  },
});

Best Practices

  1. Use token cache - Always implement SecureStore token caching
  2. Handle loading states - Check isLoaded before rendering auth-dependent UI
  3. Secure metadata - Use publicMetadata for non-sensitive data, privateMetadata for sensitive data
  4. Error handling - Implement proper error handling for auth failures
  5. Social auth - Configure OAuth providers in Clerk Dashboard before implementing

Environment Variables

# .env
EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_xxxxx

Common Issues

Issue: "Clerk is not loaded" Solution: Always check isLoaded before accessing auth state

Issue: Token not persisting Solution: Ensure SecureStore token cache is properly configured

Issue: Social auth not working Solution: Configure OAuth redirect URLs in Clerk Dashboard and app.json

Resources

Use this skill when implementing authentication, managing user sessions, or integrating Clerk with the N8ture AI App backend.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.12%
按下载量换算30

Codex

23.33%
按下载量换算25

Antigravity

17.28%
按下载量换算18

OpenCode

13.4%
按下载量换算14

windsurf

7.63%
按下载量换算8

Gemini CLI

2.95%
按下载量换算3

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills