Loading...
Loading...
Compare original and translation side by side
@clerk/expo@clerk/expo@clerk/expoClerkProviderapp.jsonapp.config.jsmetro.config.jsexpopackage.json@clerk/expo.xcodeproj.xcworkspacePackage.swiftbuild.gradle(.kts)AndroidManifest.xml@clerk/expoClerkProviderapp.jsonapp.config.jsmetro.config.jspackage.jsonexpo@clerk/expo.xcodeproj.xcworkspacePackage.swiftbuild.gradle(.kts)AndroidManifest.xmlclerk-expo-patternsclerk-expo-patternsclerk-expo-patternsskills/frameworks/clerk-expo-patterns/clerk-expo-patternsskills/frameworks/clerk-expo-patterns/clerk-expo-patternsclerk-expo-patterns| Task | Reference |
|---|---|
| Prebuilt AuthView / UserButton (fastest) | references/prebuilt.md |
| Custom hook-driven auth flows (full control) | references/custom.md |
| 任务 | 参考文档 |
|---|---|
| 预构建AuthView / UserButton(最快实现) | references/prebuilt.md |
| 自定义钩子驱动的身份验证流程(完全可控) | references/custom.md |
| Step | Action |
|---|---|
| 1 | Confirm project type is Expo/React Native (not native iOS/Android or a web-only framework) |
| 2 | Determine flow type ( |
| 3 | Ensure a real Clerk publishable key exists (or ask developer) and wire it directly to |
| 4 | Ensure |
| 5 | Inspect installed |
| 6 | For custom flows: derive Frontend API URL from publishable key, then call |
| 7 | Follow the Expo quickstart ( |
| 8 | Implement flow by following only the selected reference checklist |
| 步骤 | 操作 |
|---|---|
| 1 | 确认项目类型为Expo/React Native(而非原生iOS/Android或纯Web框架) |
| 2 | 确定流程类型( |
| 3 | 确保存在有效的Clerk发布密钥(或向开发者索要),并直接将其传入 |
| 4 | 确保已安装 |
| 5 | 检查已安装的 |
| 6 | 对于自定义流程:从发布密钥推导Frontend API URL,调用 |
| 7 | 遵循Expo快速开始指南( |
| 8 | 仅遵循所选参考文件的清单实现流程 |
User asks for Clerk in Expo/React Native
|
+-- Native iOS/Android or web-framework project detected?
| |
| +-- YES -> Do not use this skill; route to matching skill
| |
| +-- NO -> Continue
|
+-- Existing auth UI detected?
| |
| +-- Prebuilt AuthView/UserButton detected -> Load references/prebuilt.md
| |
| +-- Custom hook-based flow detected -> Load references/custom.md
| |
| +-- New implementation -> Ask developer prebuilt/custom, then load matching reference
|
+-- Ensure publishable key and direct ClerkProvider wiring
|
+-- Ensure @clerk/expo is installed and Expo config plugin is registered
|
+-- Inspect installed @clerk/expo source for selected flow
|
+-- For custom flows: call /v1/environment?_is_native=true and build enabled-factor checklist
|
+-- Verify Expo quickstart prerequisites (token cache, dev build, peer deps)
|
+-- Implement using selected flow reference用户询问Expo/React Native中的Clerk实现
|
+-- 检测到原生iOS/Android或Web框架项目?
| |
| +-- 是 -> 不使用本技能;路由到对应技能
| |
| +-- 否 -> 继续
|
+-- 检测到现有身份验证UI?
| |
| +-- 检测到预构建AuthView/UserButton -> 加载references/prebuilt.md
| |
| +-- 检测到自定义钩子流程 -> 加载references/custom.md
| |
| +-- 全新实现 -> 询问开发者选择预构建还是自定义,然后加载对应参考文件
|
+-- 确保发布密钥已配置并直接传入ClerkProvider
|
+-- 确保@clerk/expo已安装且Expo配置插件已注册
|
+-- 检查所选流程对应的@clerk/expo源码
|
+-- 对于自定义流程:调用/v1/environment?_is_native=true并构建启用因素清单
|
+-- 验证Expo快速开始的先决条件(令牌缓存、开发构建、依赖项)
|
+-- 使用所选流程参考文件实现prebuiltcustomprebuiltcustom@clerk/expo| Use Case | Source of Truth in Installed Package |
|---|---|
Package exports and sub-paths ( | |
| Hook signatures and return types | |
| Native component props and events | |
| Sign-in / sign-up status transitions | |
| SSO and OAuth behavior | |
| Native Google / Apple sign-in path | |
| Token persistence | |
| Session sync between native SDK and JS | |
| Expo config plugin behavior | |
| Required Expo setup checklist | Official Expo quickstart ( |
@clerk/expo| 使用场景 | 已安装包中的事实来源 |
|---|---|
包导出和子路径( | |
| 钩子签名和返回类型 | |
| 原生组件属性和事件 | |
| 登录/注册状态转换 | |
| SSO和OAuth行为 | |
| 原生Google/Apple登录路径 | |
| 令牌持久化 | |
| 原生SDK与JS之间的会话同步 | |
| Expo配置插件行为 | |
| 必要的Expo设置清单 | 官方Expo快速开始指南( |
<ClerkProvider publishableKey={key}>process.env.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY@clerk/exponpx expo install @clerk/expoapp.jsonapp.config.js{ "plugins": ["@clerk/expo"] }/v1/environment?_is_native=true@clerk/expo@clerk/reactuseOAuth()useSSO()useSignInWithGoogleuseSignInWithAppleuseNativeSessionuseUserProfileModaluseLocalCredentials@clerk/expo/webtokenCache@clerk/expo/token-cacheexpo-secure-store<ClerkProvider publishableKey={key}>process.env.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY@clerk/exponpx expo install @clerk/expoapp.jsonapp.config.js{ "plugins": ["@clerk/expo"] }/v1/environment?_is_native=true@clerk/expo@clerk/reactuseOAuth()useSSO()useSignInWithGoogleuseSignInWithAppleuseNativeSessionuseUserProfileModaluseLocalCredentials@clerk/expo/web@clerk/expo/token-cachetokenCacheexpo-secure-storeprebuiltcustom<ClerkProvider>tokenCache@clerk/expo/token-cache@clerk/expo@clerk/expo/v1/environment?_is_native=trueprebuiltcustom<ClerkProvider>@clerk/expo/token-cachetokenCache@clerk/expo@clerk/expo/v1/environment?_is_native=true| Level | Issue | Prevention |
|---|---|---|
| CRITICAL | Not asking for missing flow choice before implementation | Ask for |
| CRITICAL | Not asking for missing publishable key on setup tasks | Ask for key and wait before edits |
| CRITICAL | Wiring publishable key via env-var indirection by default | Pass key directly to |
| CRITICAL | Skipping | Call environment endpoint and build enabled-factor checklist before implementing |
| CRITICAL | Splitting sign-in / sign-up by default | Implement one combined sign-in-or-up flow unless developer explicitly requests separation |
| CRITICAL | Using | Always use |
| CRITICAL | Mixing native components with custom hook flows for the same auth step | Pick one flow per step; only blend with explicit developer approval |
| CRITICAL | Skipping native development build for native components/hooks | Require |
| HIGH | Using | Use |
| HIGH | Calling | |
| HIGH | Calling | Native components sync session automatically |
| HIGH | Hardcoding OAuth provider lists | Build provider lists from environment-enabled providers |
| HIGH | Recommending native-only hooks without web/Expo Go fallback | Note platform availability and provide |
| HIGH | Using this skill for native iOS/Android or web-only framework projects | Detect and route away to clerk-swift / clerk-android / web-framework skills |
| HIGH | Using | Use Verdaccio or pkg.pr.new |
| 级别 | 问题 | 预防措施 |
|---|---|---|
| 严重 | 实现前未询问缺失的流程选择 | 询问用户选择 |
| 严重 | 设置任务中未询问缺失的发布密钥 | 索要密钥,等待回复后再进行编辑 |
| 严重 | 默认通过环境变量间接传递发布密钥 | 直接将密钥传入 |
| 严重 | 自定义流程中跳过 | 实现前调用环境接口并构建启用因素清单 |
| 严重 | 默认拆分登录/注册流程 | 默认实现合并式登录/注册流程,除非开发者明确要求分离 |
| 严重 | 使用已废弃的 | 始终使用 |
| 严重 | 在同一身份验证步骤中混用原生组件和自定义钩子流程 | 每个步骤选择一种流程;仅在开发者明确批准时混合使用 |
| 严重 | 为原生组件/钩子跳过原生开发构建 | 要求使用 |
| 高 | 直接使用 | 使用 |
| 高 | 手动调用 | |
| 高 | 原生组件验证后调用 | 原生组件会自动同步会话 |
| 高 | 硬编码OAuth提供商列表 | 根据环境接口返回的启用提供商构建列表 |
| 高 | 推荐仅支持原生的钩子时未提供Web/Expo Go备选方案 | 说明平台可用性,并在必要时提供 |
| 高 | 将本技能用于原生iOS/Android或纯Web框架项目 | 检测项目类型并路由到clerk-swift/clerk-android/Web框架技能 |
| 高 | 使用 | 使用Verdaccio或pkg.pr.new |
clerkclerk-expo-patternsskills/frameworks/clerk-expo-patterns/clerk-swiftclerk-android@clerk/exponode_modules/@clerk/expo/https://github.com/clerk/javascript/tree/main/packages/expohttps://github.com/clerk/clerk-expo-quickstarthttps://clerk.com/docs/getting-started/quickstarthttps://clerk.com/docs/reference/expo/overviewclerkclerk-expo-patternsskills/frameworks/clerk-expo-patterns/clerk-swiftclerk-android@clerk/exponode_modules/@clerk/expo/https://github.com/clerk/javascript/tree/main/packages/expohttps://github.com/clerk/clerk-expo-quickstarthttps://clerk.com/docs/getting-started/quickstarthttps://clerk.com/docs/reference/expo/overview