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
| Variable | Required | Purpose |
|---|
DATABASE_URL | Yes | MongoDB connection string (Atlas recommended). |
NEXTAUTH_URL | Yes | The domain where the app runs (http://localhost:3000 in dev). |
NEXT_PUBLIC_APP_URL | Yes | Public URL used inside emails and client-side fetches. |
Authentication
| Variable | Required | Purpose |
|---|
NEXTAUTH_SECRET | Yes | Generate with `openssl rand -base64 32` to encrypt NextAuth tokens. |
GOOGLE_CLIENT_ID | Optional | Google OAuth client ID (enable the Google API + OAuth consent screen). |
GOOGLE_CLIENT_SECRET | Optional | Google OAuth client secret. |
Email & Notifications
| Variable | Required | Purpose |
|---|
RESEND_API_KEY | Optional | API key from Resend. Optional in dev because links log to console. |
EMAIL_FROM | Yes | Verified sender e.g. noreply@yourdomain.com. |
EMAIL_FROM_NAME | Yes | Friendly sender name shown in inboxes. |
ADMIN_EMAIL | Optional | Address that should receive internal alerts. |
Stripe Billing
| Variable | Required | Purpose |
|---|
STRIPE_SECRET_KEY | Optional | Server-side key (starts with sk_). Needed for live checkout. |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | Optional | Client-side key (starts with pk_). |
STRIPE_WEBHOOK_SECRET | Optional | Provided by Stripe CLI or Dashboard when you configure webhooks. |
STRIPE_STARTER_PRICE_ID | Optional | Price ID for the Starter plan. |
STRIPE_STARTER_PRODUCT_ID | Optional | Optional Stripe product reference for Starter. |
STRIPE_FOUNDATION_PRICE_ID | Optional | Price ID for Foundation plan. |
STRIPE_FOUNDATION_PRODUCT_ID | Optional | Optional Stripe product reference for Foundation. |
STRIPE_ACCELERATE_PRICE_ID | Optional | Price ID for Accelerate plan. |
STRIPE_ACCELERATE_PRODUCT_ID | Optional | Optional Stripe product reference for Accelerate. |
STRIPE_TRIAL_PERIOD_DAYS | Optional | Number of trial days applied to paid subscriptions (default 14). |
ENABLE_SUBSCRIPTION_ENFORCEMENT | Optional | Set 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.