Auth0 Expo
Use when adding authentication to Expo (React Native) mobile apps — login, logout, user sessions, protected routes, biometrics, or token management. Integrates…
Install
Quick install
npx skills add https://github.com/auth0/agent-skills/tree/HEAD/plugins/auth0/skills/auth0-exponpx skills add auth0/agent-skills --skill auth0-expo --agent claude-codenpx skills add auth0/agent-skills --skill auth0-expo --agent cursornpx skills add auth0/agent-skills --skill auth0-expo --agent codexnpx skills add auth0/agent-skills --skill auth0-expo --agent opencodenpx skills add auth0/agent-skills --skill auth0-expo --agent github-copilotnpx skills add auth0/agent-skills --skill auth0-expo --agent windsurfMore install options
Shorthand — useful for multi-skill repos:
npx skills add auth0/agent-skills --skill auth0-expoManual — clone the repo and drop the folder into your agent's skills directory:
git clone https://github.com/auth0/agent-skills.gitcp -r agent-skills/plugins/auth0/skills/auth0-expo ~/.claude/skills/auth0-expo
Use when adding authentication to Expo (React Native) mobile apps — login, logout, user sessions, protected routes, biometrics, or token management. Integrates…
auth0-expoby auth0
Use when adding authentication to Expo (React Native) mobile apps — login, logout, user sessions, protected routes, biometrics, or token management. Integrates…npx skills add https://github.com/auth0/agent-skills --skill auth0-expoDownload ZIPGitHub
Auth0 Expo Integration
Add authentication to Expo (React Native) applications using react-native-auth0 with the Expo Config Plugin.
Prerequisites
- Expo SDK 53 or higher (react-native-auth0 v5.x requires Expo 53+)
- React 19 and React Native 0.78.0 or higher
- Auth0 account with a Native application configured
- If Auth0 is not set up yet, use the
auth0-quickstartskill first
- Not compatible with Expo Go — requires custom development client or EAS Build
When NOT to Use
Use CaseRecommended SkillBare React Native CLI project (no Expo)auth0-react-nativeReact web SPA (Vite/CRA)auth0-reactNext.js applicationauth0-nextjsVue.js SPAauth0-vueAngular SPAauth0-angularExpress.js backendauth0-expressNative Android (Kotlin/Java)auth0-androidBackend API (JWT validation)auth0-fastify-api or auth0-express
Quick Start Workflow
1. Configure Auth0
For automated setup with Auth0 CLI, see Setup Guide for complete scripts.
For manual setup, configure a Native application in the Auth0 Dashboard and note your Domain and Client ID.
2. Verify Expo Dev Client
Agent instruction: Before installing the Auth0 SDK, check if the project has expo-dev-client installed. Read the project's package.json and look for expo-dev-client in dependencies or devDependencies.
*
If expo-dev-client is found: Proceed to step 3.
*
If expo-dev-client is NOT found: Use AskUserQuestion with the following message:
"The react-native-auth0 SDK requires a custom Expo development client — it does not work with Expo Go. Your project does not have expo-dev-client installed.
How would you like to proceed?
- Install it for me — I'll run
npx expo install expo-dev-clientand continue setup
- I'll set it up myself — skip this step and continue to Auth0 SDK installation"
If the user picks option 1, run:
`npx expo install expo-dev-client
`
Then proceed to step 3. If option 2, proceed to step 3 directly.
3. Install SDK
`npx expo install react-native-auth0
`
4. Configure Expo Config Plugin
Add the react-native-auth0 plugin to app.json (or app.config.js) with your Auth0 domain and a custom scheme. Also ensure bundleIdentifier (iOS) and package (Android) are set:
`{
"expo": {
"ios": { "bundleIdentifier": "com.yourcompany.yourapp" },
"android": { "package": "com.yourcompany.yourapp" },
"plugins": [
["react-native-auth0", {
"domain": "YOUR_AUTH0_DOMAIN",
"customScheme": "YOUR_CUSTOM_SCHEME"
}]
]
}
}
`
The customScheme must be all lowercase with no special characters (e.g., auth0sample). See Setup Guide for HTTPS callbacks, multiple domains, EAS Build, and secret management.
5. Configure Callback URLs
Add to Allowed Callback URLs and Allowed Logout URLs in the Auth0 Dashboard:
`YOUR_CUSTOM_SCHEME://YOUR_AUTH0_DOMAIN/ios/YOUR_BUNDLE_ID/callback,
YOUR_CUSTOM_SCHEME://YOUR_AUTH0_DOMAIN/android/YOUR_PACKAGE/callback
`
All values must be lowercase with no trailing slash. For HTTPS callback URLs (App Links / Universal Links), see Setup Guide.
6. Add Authentication with Auth0Provider
Wrap your app with Auth0Provider and use the useAuth0 hook:
Agent instruction: Before adding new UI elements, search the project for existing click handlers for login, logout, sign-in, or sign-out buttons. If existing handlers are found, hook the Auth0 code into them. Only create new buttons if no existing handlers are found.
`import React from 'react';
import { Auth0Provider, useAuth0 } from 'react-native-auth0';
import { View, Button, Text, ActivityIndicator } from 'react-native';
function HomeScreen() {
const { authorize, clearSession, user, isLoading, error } = useAuth0();
const login = async () => {
try {
await authorize(
{ scope: 'openid profile email' },
{ customScheme: 'YOUR_CUSTOM_SCHEME' }
);
} catch (e) {
console.error('Login error:', e);
}
};
const logout = async () => {
try {
await clearSession({ customScheme: 'YOUR_CUSTOM_SCHEME' });
} catch (e) {
console.error('Logout error:', e);
}
};
if (isLoading) {
return <ActivityIndicator size="large" />;
}
return (
<View>
{user ? (
<>
<Text>Welcome, {user.name}!</Text>
<Text>{user.email}</Text>
<Button title="Log Out" onPress={logout} />
</>
) : (
<Button title="Log In" onPress={login} />
)}
{error && <Text>{error.message}</Text>}
</View>
);
}
export default function App() {
return (
<Auth0Provider
domain="YOUR_AUTH0_DOMAIN"
clientId="YOUR_AUTH0_CLIENT_ID"
>
<HomeScreen />
</Auth0Provider>
);
}
`
7. Build & Verify
Agent instruction: After completing the integration, build the project to verify it compiles:
`npx expo prebuild --clean
npx expo run:ios
# or
npx expo run:android
`
If the build fails, analyze the error output. Common integration build failures include:
- "Invariant Violation: Native module cannot be null": Using Expo Go instead of a development build — run
npx expo run:iosornpx expo run:androidinstead ofnpx expo start
- Plugin not applied: Missing
react-native-auth0in app.json plugins array — verify the plugin configuration
- Pod install fails (iOS): Run
npx expo prebuild --cleanto regenerate native projects
- Manifest merge failure (Android): Conflicting auth0Domain placeholder — ensure only the config plugin sets the domain
Re-run the build after each fix. Track the number of build-fix iterations.
Failcheck: If the build still fails after 5–6 fix attempts, stop and ask the user using AskUserQuestion:
"The build is still failing after several fix attempts. How would you like to proceed?"
- Let the skill continue fixing iteratively
- Fix it manually — show the remaining errors
- Skip build verification — proceed without a successful build
Detailed Documentation
- Setup Guide — Dev client requirement, automated setup, Expo config plugin, callback URLs, EAS Build, secret management
- Integration Patterns — Login/logout, credential management, biometric auth, token refresh, organizations, DPoP, error handling
- API Reference & Testing — Configuration options, useAuth0 hook API, testing checklist, common issues, security
Common Mistakes
MistakeFixUsing Expo Go instead of development buildreact-native-auth0 requires native code. Use npx expo run:ios / npx expo run:android or create a development build with EAS.Missing customScheme in authorize/clearSession callsPass { customScheme: 'your-scheme' } as the second argument to authorize() and clearSession(). Must match the value in app.json plugin config.Callback URL mismatchEnsure callback URL is all lowercase, no trailing slash, and matches Auth0 Dashboard exactly: {customScheme}://{domain}/ios/{bundleId}/callbackApp type not set to NativeThe Auth0 application must be type Native in the Dashboard, not SPA or Regular Web.Missing bundleIdentifier or package in app.jsonBoth expo.ios.bundleIdentifier and expo.android.package must be set in app.json for callback URLs to work.Forgot to wrap app with Auth0ProviderAll components using useAuth0() must be children of Auth0Provider.Using react-native-auth0 v5.x with Expo < 53Version 5.x requires Expo 53+. Use v4.x for older Expo versions.Not testing on physical deviceBiometric authentication (Face ID, fingerprint) only works on a physical device, not simulators. Always test the full auth flow on a real device before release.
Related Skills
- auth0-quickstart — Set up an Auth0 account and application
- auth0-react-native — Bare React Native CLI projects
- auth0-mfa — Configure multi-factor authentication
- auth0-cli — Manage Auth0 resources from the terminal
References
- Auth0 Expo Quickstart
- react-native-auth0 GitHub Repository
- react-native-auth0 API Documentation
- Expo Sample App
- EXAMPLES.md
More skills from auth0
acul-screen-generatorby auth0Generates complete, branded Auth0 Advanced Custom Universal Login (ACUL) screen implementations using the React or Vanilla JS SDK. Use when a developer asks to…auth0-androidby auth0Use when adding authentication to Android applications (Kotlin/Java) with Web Auth, biometric-protected credentials, and MFA - integrates…auth0-angularby auth0Use when adding authentication to Angular applications with route guards and HTTP interceptors - integrates @auth0/auth0-angular SDK for SPAsauth0-aspnetcore-apiby auth0Use when securing ASP.NET Core Web API endpoints with JWT Bearer token validation, scope/permission checks, or stateless auth - integrates…auth0-cliby auth0Reference for Auth0 CLI commands — apps, apis, users, roles, organizations, actions, logs, custom domains, universal-login, terraform, raw API mode, and --json…auth0-expressby auth0Use when adding authentication (login, logout, protected routes) to Express.js web applications - integrates express-openid-connect for session-based auth.auth0-fastapi-apiby auth0Use when securing FastAPI API endpoints with JWT Bearer token validation, scope/permission checks, or stateless auth - integrates auth0-fastapi-api for REST…auth0-fastifyby auth0Use when adding authentication (login, logout, protected routes) to Fastify web applications - integrates @auth0/auth0-fastify for session-based auth. For…---
Source: https://github.com/auth0/agent-skills/tree/HEAD/plugins/auth0/skills/auth0-expo
Author: auth0
Discovered via: mcpservers.org
SKILL.md source
---
name: auth0-expo
description: Use when adding authentication to Expo (React Native) mobile apps — login, logout, user sessions, protected routes, biometrics, or token management. Integrates…
---
# auth0-expo
Use when adding authentication to Expo (React Native) mobile apps — login, logout, user sessions, protected routes, biometrics, or token management. Integrates…
# auth0-expoby auth0
Use when adding authentication to Expo (React Native) mobile apps — login, logout, user sessions, protected routes, biometrics, or token management. Integrates…
`npx skills add https://github.com/auth0/agent-skills --skill auth0-expo`Download ZIPGitHub
## Auth0 Expo Integration
Add authentication to Expo (React Native) applications using `react-native-auth0` with the Expo Config Plugin.
## Prerequisites
* Expo SDK 53 or higher (react-native-auth0 v5.x requires Expo 53+)
* React 19 and React Native 0.78.0 or higher
* Auth0 account with a Native application configured
* If Auth0 is not set up yet, use the `auth0-quickstart` skill first
* Not compatible with Expo Go — requires custom development client or EAS Build
## When NOT to Use
Use CaseRecommended SkillBare React Native CLI project (no Expo)`auth0-react-native`React web SPA (Vite/CRA)`auth0-react`Next.js application`auth0-nextjs`Vue.js SPA`auth0-vue`Angular SPA`auth0-angular`Express.js backend`auth0-express`Native Android (Kotlin/Java)`auth0-android`Backend API (JWT validation)`auth0-fastify-api` or `auth0-express`
## Quick Start Workflow
### 1. Configure Auth0
For automated setup with Auth0 CLI, see Setup Guide for complete scripts.
For manual setup, configure a Native application in the Auth0 Dashboard and note your Domain and Client ID.
### 2. Verify Expo Dev Client
Agent instruction: Before installing the Auth0 SDK, check if the project has `expo-dev-client` installed. Read the project's `package.json` and look for `expo-dev-client` in `dependencies` or `devDependencies`.
*
If `expo-dev-client` is found: Proceed to step 3.
*
If `expo-dev-client` is NOT found: Use `AskUserQuestion` with the following message:
"The `react-native-auth0` SDK requires a custom Expo development client — it does not work with Expo Go. Your project does not have `expo-dev-client` installed.
How would you like to proceed?
* Install it for me — I'll run `npx expo install expo-dev-client` and continue setup
* I'll set it up myself — skip this step and continue to Auth0 SDK installation"
If the user picks option 1, run:
```
`npx expo install expo-dev-client
`
```
Then proceed to step 3. If option 2, proceed to step 3 directly.
### 3. Install SDK
```
`npx expo install react-native-auth0
`
```
### 4. Configure Expo Config Plugin
Add the react-native-auth0 plugin to `app.json` (or `app.config.js`) with your Auth0 domain and a custom scheme. Also ensure `bundleIdentifier` (iOS) and `package` (Android) are set:
```
`{
"expo": {
"ios": { "bundleIdentifier": "com.yourcompany.yourapp" },
"android": { "package": "com.yourcompany.yourapp" },
"plugins": [
["react-native-auth0", {
"domain": "YOUR_AUTH0_DOMAIN",
"customScheme": "YOUR_CUSTOM_SCHEME"
}]
]
}
}
`
```
The `customScheme` must be all lowercase with no special characters (e.g., `auth0sample`). See Setup Guide for HTTPS callbacks, multiple domains, EAS Build, and secret management.
### 5. Configure Callback URLs
Add to Allowed Callback URLs and Allowed Logout URLs in the Auth0 Dashboard:
```
`YOUR_CUSTOM_SCHEME://YOUR_AUTH0_DOMAIN/ios/YOUR_BUNDLE_ID/callback,
YOUR_CUSTOM_SCHEME://YOUR_AUTH0_DOMAIN/android/YOUR_PACKAGE/callback
`
```
All values must be lowercase with no trailing slash. For HTTPS callback URLs (App Links / Universal Links), see Setup Guide.
### 6. Add Authentication with Auth0Provider
Wrap your app with `Auth0Provider` and use the `useAuth0` hook:
Agent instruction: Before adding new UI elements, search the project for existing click handlers for login, logout, sign-in, or sign-out buttons. If existing handlers are found, hook the Auth0 code into them. Only create new buttons if no existing handlers are found.
```
`import React from 'react';
import { Auth0Provider, useAuth0 } from 'react-native-auth0';
import { View, Button, Text, ActivityIndicator } from 'react-native';
function HomeScreen() {
const { authorize, clearSession, user, isLoading, error } = useAuth0();
const login = async () => {
try {
await authorize(
{ scope: 'openid profile email' },
{ customScheme: 'YOUR_CUSTOM_SCHEME' }
);
} catch (e) {
console.error('Login error:', e);
}
};
const logout = async () => {
try {
await clearSession({ customScheme: 'YOUR_CUSTOM_SCHEME' });
} catch (e) {
console.error('Logout error:', e);
}
};
if (isLoading) {
return <ActivityIndicator size="large" />;
}
return (
<View>
{user ? (
<>
<Text>Welcome, {user.name}!</Text>
<Text>{user.email}</Text>
<Button title="Log Out" onPress={logout} />
</>
) : (
<Button title="Log In" onPress={login} />
)}
{error && <Text>{error.message}</Text>}
</View>
);
}
export default function App() {
return (
<Auth0Provider
domain="YOUR_AUTH0_DOMAIN"
clientId="YOUR_AUTH0_CLIENT_ID"
>
<HomeScreen />
</Auth0Provider>
);
}
`
```
### 7. Build & Verify
Agent instruction: After completing the integration, build the project to verify it compiles:
```
`npx expo prebuild --clean
npx expo run:ios
# or
npx expo run:android
`
```
If the build fails, analyze the error output. Common integration build failures include:
* "Invariant Violation: Native module cannot be null": Using Expo Go instead of a development build — run `npx expo run:ios` or `npx expo run:android` instead of `npx expo start`
* Plugin not applied: Missing `react-native-auth0` in app.json plugins array — verify the plugin configuration
* Pod install fails (iOS): Run `npx expo prebuild --clean` to regenerate native projects
* Manifest merge failure (Android): Conflicting auth0Domain placeholder — ensure only the config plugin sets the domain
Re-run the build after each fix. Track the number of build-fix iterations.
Failcheck: If the build still fails after 5–6 fix attempts, stop and ask the user using `AskUserQuestion`:
"The build is still failing after several fix attempts. How would you like to proceed?"
* Let the skill continue fixing iteratively
* Fix it manually — show the remaining errors
* Skip build verification — proceed without a successful build
## Detailed Documentation
* Setup Guide — Dev client requirement, automated setup, Expo config plugin, callback URLs, EAS Build, secret management
* Integration Patterns — Login/logout, credential management, biometric auth, token refresh, organizations, DPoP, error handling
* API Reference & Testing — Configuration options, useAuth0 hook API, testing checklist, common issues, security
## Common Mistakes
MistakeFixUsing Expo Go instead of development buildreact-native-auth0 requires native code. Use `npx expo run:ios` / `npx expo run:android` or create a development build with EAS.Missing `customScheme` in authorize/clearSession callsPass `{ customScheme: 'your-scheme' }` as the second argument to `authorize()` and `clearSession()`. Must match the value in app.json plugin config.Callback URL mismatchEnsure callback URL is all lowercase, no trailing slash, and matches Auth0 Dashboard exactly: `{customScheme}://{domain}/ios/{bundleId}/callback`App type not set to NativeThe Auth0 application must be type Native in the Dashboard, not SPA or Regular Web.Missing bundleIdentifier or package in app.jsonBoth `expo.ios.bundleIdentifier` and `expo.android.package` must be set in app.json for callback URLs to work.Forgot to wrap app with Auth0ProviderAll components using `useAuth0()` must be children of `Auth0Provider`.Using react-native-auth0 v5.x with Expo < 53Version 5.x requires Expo 53+. Use v4.x for older Expo versions.Not testing on physical deviceBiometric authentication (Face ID, fingerprint) only works on a physical device, not simulators. Always test the full auth flow on a real device before release.
## Related Skills
* auth0-quickstart — Set up an Auth0 account and application
* auth0-react-native — Bare React Native CLI projects
* auth0-mfa — Configure multi-factor authentication
* auth0-cli — Manage Auth0 resources from the terminal
## References
* Auth0 Expo Quickstart
* react-native-auth0 GitHub Repository
* react-native-auth0 API Documentation
* Expo Sample App
* EXAMPLES.md
## More skills from auth0
acul-screen-generatorby auth0Generates complete, branded Auth0 Advanced Custom Universal Login (ACUL) screen implementations using the React or Vanilla JS SDK. Use when a developer asks to…auth0-androidby auth0Use when adding authentication to Android applications (Kotlin/Java) with Web Auth, biometric-protected credentials, and MFA - integrates…auth0-angularby auth0Use when adding authentication to Angular applications with route guards and HTTP interceptors - integrates @auth0/auth0-angular SDK for SPAsauth0-aspnetcore-apiby auth0Use when securing ASP.NET Core Web API endpoints with JWT Bearer token validation, scope/permission checks, or stateless auth - integrates…auth0-cliby auth0Reference for Auth0 CLI commands — apps, apis, users, roles, organizations, actions, logs, custom domains, universal-login, terraform, raw API mode, and --json…auth0-expressby auth0Use when adding authentication (login, logout, protected routes) to Express.js web applications - integrates express-openid-connect for session-based auth.auth0-fastapi-apiby auth0Use when securing FastAPI API endpoints with JWT Bearer token validation, scope/permission checks, or stateless auth - integrates auth0-fastapi-api for REST…auth0-fastifyby auth0Use when adding authentication (login, logout, protected routes) to Fastify web applications - integrates @auth0/auth0-fastify for session-based auth. For…
---
**Source**: https://github.com/auth0/agent-skills/tree/HEAD/plugins/auth0/skills/auth0-expo
**Author**: auth0
**Discovered via**: mcpservers.org
Related skills 6
caveman
Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
secure-linux-web-hosting
Use when setting up, hardening, or reviewing a cloud server for self-hosting, including DNS, SSH, firewalls, Nginx, static-site hosting, reverse-proxying an app, HTTPS with Let's Encrypt or ACME clients, safe HTTP-to-HTTPS redirects, or optional post-launch network tuning such as BBR.
readme-i18n
Use when the user wants to translate a repository README, make a repo multilingual, localize docs, add a language switcher, internationalize the README, or update localized README variants in a GitHub-style repository.
lark-shared
Use when first setting up lark-cli, running auth login, switching user/bot identity (--as), handling permission denied or scope errors, needing to update lark-cli, or seeing _notice in JSON output.
improve-codebase-architecture
Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in docs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.
paper-context-resolver
Optional RigorPilot helper for README-first deep learning repo reproduction. Use only when the README and repository files leave a narrow reproduction-critical gap and the task is to resolve a specific paper detail such as dataset split, preprocessing, evaluation protocol, checkpoint mapping, or runtime assumption from primary paper sources while recording conflicts. Do not use for general paper summary, repo scanning, environment setup, command execution, title-only paper lookup, or replacin...