Environment Configuration
Complete environment variable setup guide for the downloadable template spec
How To Use This Section
This environment guide is organized by integration area. Open each area page and copy values into your .env.local.
Template Version Note
This section follows the new downloadable template spec from this guide. It intentionally focuses on those variables.
Variable Index
| Variable | Area | Notes |
|---|---|---|
VERCEL_EDGE_CONFIG_ID | Edge Config | Required for feature-flag read access |
VERCEL_EDGE_CONFIG_TOKEN | Edge Config | Required for feature-flag read access |
VERCEL_API_TOKEN | Edge Config | Optional, used for write/update operations |
DATABASE_URL | Database | PostgreSQL connection string |
BETTER_AUTH_SECRET | Auth Secret | High-entropy secret for auth signing |
STRIPE_SECRET_KEY | Stripe | Stripe server-side API key |
STRIPE_WEBHOOK_SECRET | Stripe | Stripe webhook signing secret |
NEXT_PUBLIC_FIREBASE_API_KEY | Firebase | Firebase web SDK config |
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN | Firebase | Firebase Auth domain |
NEXT_PUBLIC_FIREBASE_PROJECT_ID | Firebase | Firebase project ID |
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET | Firebase | Firebase Storage bucket |
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID | Firebase | Firebase messaging sender ID |
NEXT_PUBLIC_FIREBASE_APP_ID | Firebase | Firebase web app ID |
NEXT_PUBLIC_GA_ID | Firebase | Google Analytics measurement ID |
S3_ENDPOINT | Storage | Optional custom endpoint (R2/MinIO/etc.) |
S3_REGION | Storage | Region or auto for R2 |
S3_ACCESS_KEY | Storage | Access key ID |
S3_SECRET_KEY | Storage | Secret access key |
S3_BUCKET | Storage | Bucket name |
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY | Google Maps | Browser maps API key |
NEXT_PUBLIC_GOOGLE_MAP_ID | Google Maps | Required for map style rendering |
GOOGLE_CLOUD_CLIENT_EMAIL | Google Cloud | Service account client email |
GOOGLE_CLOUD_PRIVATE_KEY | Google Cloud | Service account private key |
GOOGLE_CLIENT_ID | OAuth | Google OAuth client ID |
GOOGLE_CLIENT_SECRET | OAuth | Google OAuth client secret |
GITHUB_CLIENT_ID | OAuth | GitHub OAuth client ID |
GITHUB_CLIENT_SECRET | OAuth | GitHub OAuth client secret |
RESEND_API_KEY | Resend API key | |
EMAIL_SENDER | Display name for sender | |
EMAIL_DOMAIN | Primary sender domain | |
NODEMAILER_EMAIL_HOST | SMTP host | |
NODEMAILER_EMAIL_PORT | SMTP port | |
NODEMAILER_EMAIL_USERNAME | SMTP username | |
NODEMAILER_EMAIL_PASSWORD | SMTP password | |
NODEMAILER_FALLBACK_EMAIL | Fallback from address | |
SENTRY_AUTH_TOKEN | Sentry | Token for source maps and integrations |
SENTRY_ORG | Sentry | Sentry organization slug |
SENTRY_PROJECT | Sentry | Sentry project slug |
NEXT_PUBLIC_SENTRY_DSN | Sentry | Public DSN for browser/server SDK init |
Area Guides
Edge Config
Vercel Edge Config IDs, read token, and optional write token.
Database
Neon and Supabase setup for DATABASE_URL.
Auth Secret
Generate and manage BETTER_AUTH_SECRET securely.
Stripe
Stripe API key and webhook signing secret setup.
Firebase
Firebase web app config and analytics measurement ID.
Storage
Firebase Storage provider setup and S3-compatible configuration.
Google Maps + Cloud
Maps API keys, map style ID, and service account credentials.
OAuth
Google and GitHub OAuth app credentials.
Resend and SMTP (Nodemailer) configuration.
Sentry
Project setup, DSN, and auth token mapping.
Troubleshooting Quick Links
- Database bootstrap commands: Database Setup
- Common command reference: Development Commands
- OAuth callback troubleshooting: Auth Providers
- Feature flag behavior details: Feature Flags