Developer DocumentationEnvironment Variables

Environment Variables

[!NOTE] Never commit .env.local. Keep secrets in local files and Cloud Run Secret Manager bindings.

Required and optional variables

VariableRequiredPurposeSource
DATABASE_URLYesNeon pooled runtime connectionNeon project dashboard
DIRECT_URLYesdirect DB connection for migrationsNeon project dashboard
NEXTAUTH_URLYespublic app URL used by auth callbackslocal/prod app URL
NEXTAUTH_SECRETYesNextAuth signing secretgenerate securely
GOOGLE_CLIENT_IDYes for Google authOAuth loginGoogle Cloud Console
GOOGLE_CLIENT_SECRETYes for Google authOAuth loginGoogle Cloud Console
RESEND_API_KEYYes for email flowstransactional emailResend dashboard
PAYSTACK_SECRET_KEYYes for billing/webhookreport download billingPaystack dashboard
UPSTASH_REDIS_REST_URLOptional but recommendeddistributed rate limitingUpstash dashboard
UPSTASH_REDIS_REST_TOKENOptional but recommendeddistributed rate limitingUpstash dashboard
GROQ_API_KEYOptional per AI feature usageAI providerGroq console
OPENROUTER_API_KEYOptional fallbackAI providerOpenRouter console
ANTHROPIC_API_KEYOptional report providerAI providerAnthropic console
CRON_SECRETYes for cron protectionsecure cron routesgenerated secret
SUPER_ADMIN_EMAILRecommendedadmin allowlist emailoperator config
SUPER_ADMIN_EMAIL_2Optionalsecond admin allowlist emailoperator config
R2_ACCOUNT_IDOptional if using R2object storageCloudflare
R2_ACCESS_KEY_IDOptional if using R2object storageCloudflare
R2_SECRET_ACCESS_KEYOptional if using R2object storageCloudflare
R2_BUCKET_NAMEOptional if using R2object storageCloudflare
R2_PUBLIC_URLOptional if using R2public asset base URLCloudflare

Example .env.local

DATABASE_URL=postgresql://USER:PASSWORD@HOST-pooler.neon.tech/DB?sslmode=require
DIRECT_URL=postgresql://USER:PASSWORD@HOST.neon.tech/DB?sslmode=require
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=replace_with_long_random_secret
GOOGLE_CLIENT_ID=replace_with_google_client_id
GOOGLE_CLIENT_SECRET=replace_with_google_client_secret
RESEND_API_KEY=replace_with_resend_key
PAYSTACK_SECRET_KEY=replace_with_paystack_secret
UPSTASH_REDIS_REST_URL=replace_with_upstash_url
UPSTASH_REDIS_REST_TOKEN=replace_with_upstash_token
GROQ_API_KEY=replace_with_groq_key
OPENROUTER_API_KEY=replace_with_openrouter_key
ANTHROPIC_API_KEY=replace_with_anthropic_key
CRON_SECRET=replace_with_cron_secret
SUPER_ADMIN_EMAIL=admin1@example.com
SUPER_ADMIN_EMAIL_2=admin2@example.com
R2_ACCOUNT_ID=replace_with_r2_account_id
R2_ACCESS_KEY_ID=replace_with_r2_access_key
R2_SECRET_ACCESS_KEY=replace_with_r2_secret
R2_BUCKET_NAME=eventslot-assets
R2_PUBLIC_URL=https://assets.example.com

Keep .env out of git

  • Ensure .env.local is listed in .gitignore.
  • Never paste real secrets into issues, PRs, or docs.