Overview
Understand the authentication integration in the boilerplate.
AI Boilerplate uses Better Auth for authentication.
Better Auth
Better Auth is a framework-agnostic authentication library. It provides a plugin-based architecture that makes it easy to add providers and extend functionality.
Features
| Feature | Description |
|---|---|
| Email & Password | Traditional sign-in with email verification. |
| Magic Link | Passwordless sign-in. |
| Google OAuth | Sign in with Google. |
| GitHub OAuth | Sign in with GitHub. |
| Session Management | List and revoke active sessions. |
How It Works
- authentication is configured in
packages/auth/src/server.ts. - The API is mounted at
/api/auth/[...all]in the dashboard application. - Feature flags in
packages/utils/src/constants/features.tscontrol which methods are enabled. - Server components check sessions via
auth.api.getSession()to protect routes. - Client components use
useSession()from@package/auth/clientto access the session.
Next Steps
- Configure authentication
- Magic Link setup
- Google OAuth setup
- GitHub OAuth setup