Loading...
Loading...
Implement Clerk authentication for Expo and React Native apps using @clerk/expo source-guided patterns. Use for prebuilt AuthView/UserButton or custom hook-driven auth flows. Do not use for native iOS/Swift, native Android/Kotlin, or web framework projects.
npx skill4agent add clerk/skills clerk-expo@clerk/expo@clerk/expoClerkProviderapp.jsonapp.config.jsmetro.config.jsexpopackage.json@clerk/expo.xcodeproj.xcworkspacePackage.swiftbuild.gradle(.kts)AndroidManifest.xmlclerk-expo-patternsclerk-expo-patternsskills/frameworks/clerk-expo-patterns/clerk-expo-patterns| Task | Reference |
|---|---|
| Prebuilt AuthView / UserButton (fastest) | references/prebuilt.md |
| Custom hook-driven auth flows (full control) | 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 |
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 referenceprebuiltcustom@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 ( |
<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-storeprebuiltcustom<ClerkProvider>tokenCache@clerk/expo/token-cache@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 |
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/overview