https://github.com/reeceyang/expo-router-convex-auth
Expo Router and Convex Auth example
https://github.com/reeceyang/expo-router-convex-auth
convex convex-auth expo expo-router react-native
Last synced: 3 months ago
JSON representation
Expo Router and Convex Auth example
- Host: GitHub
- URL: https://github.com/reeceyang/expo-router-convex-auth
- Owner: reeceyang
- Created: 2024-11-22T22:42:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-25T04:15:09.000Z (over 1 year ago)
- Last Synced: 2025-03-12T16:52:06.107Z (over 1 year ago)
- Topics: convex, convex-auth, expo, expo-router, react-native
- Language: TypeScript
- Homepage: https://expo-router-convex-auth.vercel.app/
- Size: 460 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Expo Router Convex Auth Example
An example of using [Convex Auth](https://labs.convex.dev/auth) with [Expo Router](https://docs.expo.dev/router/introduction/) and [gluestack-ui](https://gluestack.io/) components. This app uses the [Passwords](https://labs.convex.dev/auth/config/passwords) authentication method with email verification using the [Resend](https://resend.com/) email provider.
This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app). You can try out the public preview at [expo-router-convex-auth.vercel.app](https://expo-router-convex-auth.vercel.app/), or build the Android or iOS apps following the instructions below.


## Get started
1. Install dependencies
```bash
pnpm install
```
2. Set up the Convex project
```bash
npx convex dev
```
3. Set up Convex Auth and environment variables
```bash
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:
```bash
npx convex env set SITE_URL http://localhost:3000
```
Sign up for [Resend](https://resend.com/), obtain your API key, and set the `AUTH_RESEND_KEY` environment variable:
```bash
npx convex env set AUTH_RESEND_KEY yourresendkey
```
2. Start the app
```bash
npx expo start
```
In the output, you'll find options to open the app in a
- [development build](https://docs.expo.dev/develop/development-builds/introduction/)
- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/)
- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/)
- [Expo Go](https://expo.dev/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](https://docs.expo.dev/router/introduction).