Documentation

Environment Variables Reference

Every purchase ships with a .env.example file. Copy it to .env after unzipping the download, then replace the placeholders below with real credentials.

Database & URLs

VariableRequiredPurpose
DATABASE_URLYesMongoDB connection string (Atlas recommended).
NEXTAUTH_URLYesThe domain where the app runs (http://localhost:3000 in dev).
NEXT_PUBLIC_APP_URLYesPublic URL used inside emails and client-side fetches.

Authentication

VariableRequiredPurpose
NEXTAUTH_SECRETYesGenerate with `openssl rand -base64 32` to encrypt NextAuth tokens.
GOOGLE_CLIENT_IDOptionalGoogle OAuth client ID (enable the Google API + OAuth consent screen).
GOOGLE_CLIENT_SECRETOptionalGoogle OAuth client secret.

Email & Notifications

VariableRequiredPurpose
RESEND_API_KEYOptionalAPI key from Resend. Optional in dev because links log to console.
EMAIL_FROMYesVerified sender e.g. noreply@yourdomain.com.
EMAIL_FROM_NAMEYesFriendly sender name shown in inboxes.
ADMIN_EMAILOptionalAddress that should receive internal alerts.

Stripe Billing

VariableRequiredPurpose
STRIPE_SECRET_KEYOptionalServer-side key (starts with sk_). Needed for live checkout.
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYOptionalClient-side key (starts with pk_).
STRIPE_WEBHOOK_SECRETOptionalProvided by Stripe CLI or Dashboard when you configure webhooks.
STRIPE_STARTER_PRICE_IDOptionalPrice ID for the Starter plan.
STRIPE_STARTER_PRODUCT_IDOptionalOptional Stripe product reference for Starter.
STRIPE_FOUNDATION_PRICE_IDOptionalPrice ID for Foundation plan.
STRIPE_FOUNDATION_PRODUCT_IDOptionalOptional Stripe product reference for Foundation.
STRIPE_ACCELERATE_PRICE_IDOptionalPrice ID for Accelerate plan.
STRIPE_ACCELERATE_PRODUCT_IDOptionalOptional Stripe product reference for Accelerate.
STRIPE_TRIAL_PERIOD_DAYSOptionalNumber of trial days applied to paid subscriptions (default 14).
ENABLE_SUBSCRIPTION_ENFORCEMENTOptionalSet to "true" to block premium pages unless a subscription exists.

Tips

  • Keep a separate .env.local for secrets you never want to ship with the template you resell.
  • When deploying to Vercel, paste everything under Project Settings → Environment Variables. Redeploy after updating secrets.
  • Rotate Stripe and Resend keys whenever you share a copy of the boilerplate with a customer.