Introduction
Database
Payments
Every environment variable explained — what it does, where to get it, and whether it's required.
All variables live in .env.local. Copy .env.example to get the full template with comments.
Never commit .env.local to git. It's already in .gitignore. For
production, set these variables in your hosting platform (Vercel, Railway,
etc.) directly.
App
| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_APP_URL | ✓ | Full URL of your app — http://localhost:3000 in dev, https://yourdomain.com in prod. Used by auth callbacks, email links, and passkeys. |
NEXT_PUBLIC_APP_NAME | — | Display name shown in emails and the auth UI. Defaults to launch.now. |
Database
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | ✓ | PostgreSQL connection string. Format: postgresql://user:password@host:5432/dbname. Get it from Neon, Supabase, or your local Postgres. |
Authentication
| Variable | Required | Description |
|---|---|---|
BETTER_AUTH_SECRET | ✓ | Long random string used to sign session tokens and cookies. Generate with openssl rand -base64 32. Changing this invalidates all active sessions. |
BETTER_AUTH_BASE_URL | ✓ | Same as NEXT_PUBLIC_APP_URL but not exposed to the client. Used by Better Auth to construct callback URLs server-side. |
GitHub OAuth
| Variable | Required | Description |
|---|---|---|
GITHUB_CLIENT_ID | — | From your GitHub OAuth App settings. |
GITHUB_CLIENT_SECRET | — | From your GitHub OAuth App settings. |
Google OAuth
| Variable | Required | Description |
|---|---|---|
GOOGLE_CLIENT_ID | — | From Google Cloud Console → Credentials. |
GOOGLE_CLIENT_SECRET | — | From Google Cloud Console → Credentials. |
Passkeys
| Variable | Required | Description |
|---|---|---|
PASSKEY_RP_ID | — | Your bare domain — localhost in dev, yourdomain.com in prod. Must match exactly. |
| Variable | Required | Description |
|---|---|---|
RESEND_API_KEY | — | Your Resend API key. Required for password reset emails, email verification, and organization invitations. Get it from resend.com. |
EMAIL_FROM | — | The sender address for transactional emails. Must be a verified domain in Resend. Example: noreply@yourdomain.com. |
Billing
| Variable | Required | Description |
|---|---|---|
STRIPE_SECRET_KEY | — | Server-side Stripe key. Starts with sk_test_ in dev, sk_live_ in prod. |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | — | Client-side Stripe key. Starts with pk_test_ or pk_live_. |
STRIPE_WEBHOOK_SECRET | — | Webhook signing secret from the Stripe dashboard. Used to verify incoming webhook events. Starts with whsec_. |
Full .env.local template
# ── App ──────────────────────────────────────────────────────────────────
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_APP_NAME=launch.now
# ── Database ─────────────────────────────────────────────────────────────
DATABASE_URL=postgresql://postgres:password@localhost:5432/myapp
# ── Auth ─────────────────────────────────────────────────────────────────
BETTER_AUTH_SECRET= # openssl rand -base64 32
BETTER_AUTH_BASE_URL=http://localhost:3000
# GitHub OAuth
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
# Google OAuth
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
# Passkeys
PASSKEY_RP_ID=localhost
# ── Email ─────────────────────────────────────────────────────────────────
RESEND_API_KEY=
EMAIL_FROM=noreply@yourdomain.com
# ── Billing ───────────────────────────────────────────────────────────────
STRIPE_SECRET_KEY=
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
STRIPE_WEBHOOK_SECRET=Ship your SaaS this week
Auth, billing, orgs, and emails — all wired up. Clone and deploy in minutes.
Get launch.now