Guides
Github Authentication
Cyrux uses better auth for authentication, check its docs for more information.
Setup
- If you still haven't, run the following commands to add env variables to your Convex dashboard.
npx convex env set SITE_URL http://localhost:3000
npx convex env set BETTER_AUTH_SECRET=$(openssl rand -base64 32)Set your site URL to https://[yourdomain] in production.
-
Go to GitHub and open Settings.
-
Scroll down to Developer settings (bottom left).
-
Click on OAuth Apps → New OAuth App.
-
Fill in the OAuth App form:
| Field | Value |
|---|---|
| Application name | [Anything you want] |
| Homepage URL | http://localhost:3000 |
| Authorization callback URL | http://localhost:3000/api/auth/callback/github |
Add your production URL as well: https://[yourdomain]/api/auth/callback/github
-
Click Register application.
-
Copy your Client ID and generate a Client Secret.
-
Run the following commands to add env variables to your Convex dev deployment:
npx convex env set GITHUB_CLIENT_ID [your client id]
npx convex env set GITHUB_CLIENT_SECRET [your client secret]- All done, you can now login using your GitHub account.
Go to http://localhost:3000/sign-in and click on the login with GitHub button.