Create new

Environment Variables

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

VariableRequiredDescription
NEXT_PUBLIC_APP_URLFull 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_NAMEDisplay name shown in emails and the auth UI. Defaults to launch.now.

Database

VariableRequiredDescription
DATABASE_URLPostgreSQL connection string. Format: postgresql://user:password@host:5432/dbname. Get it from Neon, Supabase, or your local Postgres.

Authentication

VariableRequiredDescription
BETTER_AUTH_SECRETLong random string used to sign session tokens and cookies. Generate with openssl rand -base64 32. Changing this invalidates all active sessions.
BETTER_AUTH_BASE_URLSame as NEXT_PUBLIC_APP_URL but not exposed to the client. Used by Better Auth to construct callback URLs server-side.

GitHub OAuth

VariableRequiredDescription
GITHUB_CLIENT_IDFrom your GitHub OAuth App settings.
GITHUB_CLIENT_SECRETFrom your GitHub OAuth App settings.

Google OAuth

VariableRequiredDescription
GOOGLE_CLIENT_IDFrom Google Cloud Console → Credentials.
GOOGLE_CLIENT_SECRETFrom Google Cloud Console → Credentials.

Passkeys

VariableRequiredDescription
PASSKEY_RP_IDYour bare domain — localhost in dev, yourdomain.com in prod. Must match exactly.

Email

VariableRequiredDescription
RESEND_API_KEYYour Resend API key. Required for password reset emails, email verification, and organization invitations. Get it from resend.com.
EMAIL_FROMThe sender address for transactional emails. Must be a verified domain in Resend. Example: noreply@yourdomain.com.

Billing

VariableRequiredDescription
STRIPE_SECRET_KEYServer-side Stripe key. Starts with sk_test_ in dev, sk_live_ in prod.
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYClient-side Stripe key. Starts with pk_test_ or pk_live_.
STRIPE_WEBHOOK_SECRETWebhook 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=