Authentication
Magic Link (Resend)
Email magic link sign-in with Better Auth and Resend.
Overview
Magic Link auth uses Better Auth + Resend to email a one-time login link.
Base auth variables
BETTER_AUTH_SECRET=your_generated_secret
BETTER_AUTH_URL=https://shipkit.one
NEXT_PUBLIC_APP_URL=https://shipkit.oneGenerate a secret locally:
openssl rand -base64 32Resend setup
- Create a Resend API key.
- Verify your domain and set a sender email (e.g.
no-reply@shipkit.one).
References:
Add to env vars:
RESEND_API_KEY=your_resend_api_key
EMAIL_FROM=no-reply@shipkit.oneVerify the flow
- Open
/loginand choose Magic Link. - Enter your email and open the link.
- Confirm the session is created and you land in the app.