An example of using Convex Auth with Expo Router and gluestack-ui components. This app uses the Passwords authentication method with email verification using the Resend email provider.
This is an Expo project created with create-expo-app
. You can try out the public preview at expo-router-convex-auth.vercel.app, or build the Android or iOS apps following the instructions below.
-
Install dependencies
pnpm install
-
Set up the Convex project
npx convex dev
-
Set up Convex Auth and environment variables
npx @convex-dev/auth
Set the
SITE_URL
environment variable (https://labs.convex.dev/auth/setup/manual#configure-site_url):OTP providers require a SITE_URL variable even though the value is not used. Set this to a placeholder value if using OTPs with React Native:
npx convex env set SITE_URL http://localhost:3000
Sign up for Resend, obtain your API key, and set the
AUTH_RESEND_KEY
environment variable:npx convex env set AUTH_RESEND_KEY yourresendkey
-
Start the app
npx expo start
In the output, you'll find options to open the app in a
- development build
- Android emulator
- iOS simulator
- Expo Go, a limited sandbox for trying out app development with Expo
You can start developing by editing the files inside the app directory. This project uses file-based routing.