Clerk is a developer-first authentication and user management solution. It provides pre-built React components and hooks for sign-in, sign-up, user profile, and organization management. Clerk is designed to be easy to use and customize, and can be dropped into any React or Next.js application.
This quickstart demonstrates how to integrate Clerk with Expo and works with Expo Go out of the box. Native Apple Sign-In is available as an optional feature that requires a native build.
After following the quickstart you'll have learned how to:
- Install
@clerk/clerk-expo - Setup your environment key
- Wrap your Expo app in
<ClerkProvider />and supply yourtokenCache - Conditionally show content based on your auth state
- Build your sign-in and sign-up pages
- (Optional) Enable native Apple Sign-In on iOS
git clone https://github.com/clerk/clerk-expo-quickstart
cd clerk-expo-quickstart-
Sign up for a Clerk account at https://clerk.com.
-
Go to the Clerk dashboard and create an application.
-
Copy your publishable key from the Clerk Dashboard.
-
Create a
.envfile in the root directory:cp .env.example .env
-
Add your Clerk publishable key to
.env:EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_xxx
npm installnpm startScan the QR code with:
- iOS: Camera app
- Android: Expo Go app
The app will run with email/password authentication by default.
# Using EAS Build (cloud-based)
npx eas-cli build --platform ios --profile development
# Or local build
npx expo prebuild
npx expo run:ios- Email and password authentication
- Email verification
- Session management
- Protected routes
- Works with Expo Go
Native Apple Sign-In is disabled by default and requires additional setup:
Requirements:
- Apple Developer Account ($99/year)
- Native build (EAS Build or local prebuild)
- Configuration in Apple Developer Console and Clerk Dashboard
To enable:
-
Follow the complete setup guide: TODO: link docs here.
-
Uncomment the Apple Sign-In button in:
app/(auth)/sign-in.tsxapp/(auth)/sign-up.tsx
-
Build with EAS or local prebuild (Apple Sign-In doesn't work in Expo Go)
For detailed instructions, see APPLE_SIGNIN_SETUP.md.
EAS Build is the easiest way to create production builds with automatic code signing.
Setup:
# Install EAS CLI
npm install -g eas-cli
# Login to Expo
eas login
# Configure your project
eas build:configureBuild for iOS:
# Development build (for testing)
eas build --platform ios --profile development
# Production build (for App Store)
eas build --platform ios --profile productionBuild for Android:
# Development build (for testing)
eas build --platform android --profile development
# Production build (for Play Store)
eas build --platform android --profile productionIf you prefer to build locally:
# Generate native projects
npx expo prebuild
# Build for iOS (requires macOS and Xcode)
npx expo run:ios --configuration Release
# Build for Android
npx expo run:android --variant releaseβββ app/
β βββ (auth)/
β β βββ sign-in.tsx # Sign-in screen
β β βββ sign-up.tsx # Sign-up screen
β βββ (home)/
β β βββ index.tsx # Home screen (protected)
β βββ components/
β β βββ AppleSignInButton.tsx # Optional Apple Sign-In component
β βββ _layout.tsx # Root layout with ClerkProvider
βββ .env.example # Environment variables template
βββ eas.json # EAS Build configuration
βββ APPLE_SIGNIN_SETUP.md # Apple Sign-In setup guide
Create a .env file with:
# Required: Your Clerk publishable key
EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_xxx
# Optional: Only needed for EAS Build with Apple Sign-In
# APPLE_TEAM_ID=ABC123DEF4See .env.example for more details.
To learn more about Clerk and Expo, check out the following resources:
- Quickstart: Get started with Expo and Clerk
- Clerk Documentation
- Expo Documentation
- EAS Build Documentation
- Make sure you've created a
.envfile withEXPO_PUBLIC_CLERK_PUBLISHABLE_KEY - Restart the development server after adding environment variables
- Clear Metro bundler cache:
npx expo start --clear - Delete
node_modulesand reinstall:rm -rf node_modules && npm install
- Verify you've followed all steps in APPLE_SIGNIN_SETUP.md
- Apple Sign-In requires a native build (doesn't work in Expo Go)
- Check that the capability is enabled in your Apple Developer account
Feel free to create a support thread on our Discord. Our support team will be happy to assist you in the #support channel.
You can discuss ideas, ask questions, and meet others from the community in our Discord.
If you prefer, you can also find support through our Twitter, or you can email us!
