Configure
Learn how to set up authentication with Better Auth.
Generate Secret Key
The secret key is used to encrypt session tokens and sign cookies.
Update the environment variables
Replace the BETTER_AUTH_SECRET in the .env file with the generated secret key.
Also ensure BETTER_AUTH_URL points to your dashboard application:
BETTER_AUTH_URL=http://localhost:3000
BETTER_AUTH_SECRET=your-generated-secret-hereConfigure Authentication Providers
In the next sections, we will configure the authentication providers:
- Magic Link (requires email setup)
- Google OAuth
- GitHub OAuth
You can enable or disable any provider through feature flags.