cyrux

Guides

Github Authentication

Cyrux uses better auth for authentication, check its docs for more information.

Setup

  1. 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.

  1. Go to GitHub and open Settings.

  2. Scroll down to Developer settings (bottom left).

  3. Click on OAuth AppsNew OAuth App.

  4. Fill in the OAuth App form:

FieldValue
Application name[Anything you want]
Homepage URLhttp://localhost:3000
Authorization callback URLhttp://localhost:3000/api/auth/callback/github

Add your production URL as well: https://[yourdomain]/api/auth/callback/github

  1. Click Register application.

  2. Copy your Client ID and generate a Client Secret.

  3. 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]
  1. 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.

On this page