GuidesAuth Providers
Credentials (Email + Password)
Set up classic email and password authentication with reset support.
Docs are in beta — content is improving rapidly. Found something missing? Open an issue on GitHub or reach out on Twitter (X).
BetterStarter supports email/password authentication through Better Auth emailAndPassword.
Local Development Expectations
Credentials auth works locally without Plunk.
- Sign up and sign in with email/password work with just the database
- Without Plunk, BetterStarter logs reset-password links to the server console in development
- With Plunk configured locally, BetterStarter sends real reset emails
- In production, you need Plunk or another real email provider for reset and other email flows
1. Enable In Config
In src/appConfig.ts set:
credentials: { enabled: true },2. Fastest Local Test
- Run
pnpm dev - Navigate to
/auth/sign-upand create an account with email/password - Sign out, then sign in at
/auth/sign-in - Test reset flow from
/auth/forgot-password - Copy the reset link from the server console
3. Optional: Set Up Plunk For Reset Emails
Credentials auth itself does not require an email provider, but password reset emails do.
- Create a free account at useplunk.com
- Verify your sending domain
- Copy your Secret API key
4. Set Environment Variables
# .env.local
PLUNK_SECRET_API_KEY=your_plunk_secret_api_key
TRANSACTIONAL_EMAIL=noreply@yourdomain.com5. Test With Real Email Delivery
- Run
pnpm dev - Navigate to
/auth/sign-upand create an account with email/password - Sign out, then sign in at
/auth/sign-in - Test reset flow from
/auth/forgot-password - In development, reset links are still logged to the server console
Configuration
Credentials auth is configured in src/features/auth/index.ts:
emailAndPassword.enabledusesproviders.credentials.enabledsendResetPasswordcallssendResetPasswordEmail- Reset email template is in
src/features/email/templates/ResetPasswordEmail.tsx
In development, the auth layer also logs the generated reset-password URL before sending.
Reset and forgot-password route keys are defined in src/features/auth/constants.ts.
Swapping Email Providers
To switch providers, replace transport logic in src/features/email/transport.ts.
Troubleshooting
- No credentials fields in auth UI — check
credentials.enabledinsrc/appConfig.ts - No reset email in local development — check the server console for the logged reset link
- Reset email not delivered with Plunk enabled — verify Plunk API key, sender email, and DNS setup (SPF/DKIM/DMARC)
- Reset link invalid or wrong domain — verify
APP_BASE_URLandBETTER_AUTH_URL