—Authentication
Enable Google + GitHub sign-in
Axiom uses NextAuth. Google and GitHub providers are wired in code but only register when their environment credentials are present on the host. Set the env vars below and the buttons on the sign-in page activate automatically.
Three things to configure for each provider
Overview
- Create an OAuth application with the provider (Google Cloud Console / GitHub OAuth Apps).
- Register the callback URL pointing at your Axiom host.
- Set the resulting Client ID + Client Secret on your host as environment variables.
Info
Required for every deployment regardless of provider
1. Base NextAuth env
bash# Required for every deployment
NEXTAUTH_URL=https://your-domain.example.com
NEXTAUTH_SECRET=<openssl rand -base64 32>
NEXTAUTH_URL must exactly match the public origin (no trailing slash). On Vercel set it under Project → Settings → Environment Variables for Production + Preview environments.
2. Google sign-in
Create an OAuth client
Open the Google Cloud Console → APIs & Services → Credentials. Click Create Credentials → OAuth client ID → Web application.
Add the authorized redirect URI
Under Authorized redirect URIs, add:
texthttps://your-domain.example.com/api/auth/callback/googleFor local development add http://localhost:3000/api/auth/callback/google as well.
Copy the credentials
Google shows a Client ID + Client Secret. Treat the secret as you would an API key.
Set env on the host
bashGOOGLE_CLIENT_ID=1234567890-abc.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxxxxHeads up
openid email profile is the NextAuth default). For external apps you'll need to publish the consent screen to leave test mode and accept non-test users.3. GitHub sign-in
Create an OAuth app
Open GitHub → Settings → Developer settings → OAuth Apps and click New OAuth App.
Set the callback URL
Homepage URL: https://your-domain.example.com
Authorization callback URL:
texthttps://your-domain.example.com/api/auth/callback/githubGenerate a client secret
After saving, click Generate a new client secret. GitHub shows the secret once — copy it immediately.
Set env on the host
bashGITHUB_CLIENT_ID=Iv1.xxxxxxxxxxxxxxxx
GITHUB_CLIENT_SECRET=ghp_xxxxxxxxxxxxxxxxxxxxxxxxInfo
4. Verify it works
- Redeploy after setting the env vars (env changes don't auto-rebuild on most hosts).
- Open the sign-in page in an incognito window.
- Both buttons should activate (no Not set badge).
- Click → OAuth consent → you land in
/dashboard.
Heads up
error=Configuration after the OAuth round-trip, the env var is set but doesn't match what the provider was registered with. Double-check the callback URL.Troubleshooting
Button shows Not set
Env vars not present on the host. Re-check Vercel → Settings → Environment Variables. Remember to redeploy.
Redirect URI mismatch
The exact callback URL registered with the provider must match the one NextAuth requests. For Vercel previews, you'll either need a wildcard preview domain on Google (not supported — use a single preview URL) or limit OAuth to production.
Works locally but not in production
NEXTAUTH_URL not set or doesn't match the production origin. NextAuth uses this to construct callback URLs.
Need a human?
Most flows are documented — but we'll help if anything is unclear.
Need help? Open a security review request.