ShipKit.one
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.one

Generate a secret locally:

openssl rand -base64 32

Resend setup

  1. Create a Resend API key.
  2. 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.one

Verify the flow

  1. Open /login and choose Magic Link.
  2. Enter your email and open the link.
  3. Confirm the session is created and you land in the app.

On this page