Skip to main content

Environment Variables

Every DirectoryLaunch environment variable, what it does, whether it is required, and where to grab the value — Supabase, Stripe, Resend and more.

All env vars live in .env.local for local dev and in Vercel → Settings → Environment Variables for production. The file .env.example in the repo is kept up to date — copy it with cp .env.example .env.local.

Naming rule

Variables starting with NEXT_PUBLIC_ are exposed to the browser. Everything else stays server-only. Never prefix a secret key with NEXT_PUBLIC_.

App

VariableRequired?Value
NEXT_PUBLIC_APP_URLrequiredYour production URL. Local: http://localhost:3000. Used for SEO, OG tags, email links.
NEXT_PUBLIC_URLoptionalFallback URL for payment redirects. Defaults to request host.
NEXT_PUBLIC_APP_MODEoptionalSet to demo to let visitors browse the admin and all pages without auth (writes blocked). Leave unset in production.

Supabase

The project prefers Supabase's new API key format (sb_publishable_… / sb_secret_…) and falls back to the legacy JWT keys, so older projects keep working.

VariableRequired?Value
NEXT_PUBLIC_SUPABASE_URLrequiredSupabase → Settings → API → Project URL
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEYrequiredSupabase → Settings → API Keys → publishable key (sb_publishable_…)
SUPABASE_SECRET_KEYrequiredSupabase → Settings → API Keys → secret key (sb_secret_…). Server-only!
SUPABASE_PROJECT_IDoptionalFor pnpm supabase:types. Your project ref.
On an older Supabase project?

The legacy keys still work as a fallback: NEXT_PUBLIC_SUPABASE_ANON_KEY (in place of the publishable key) and SUPABASE_SERVICE_ROLE_KEY (in place of the secret key). Use one pair or the other — prefer the new names for new projects.

Supabase storage (S3)

VariableRequired?Value
SUPABASE_S3_ENDPOINTrequired for uploadshttps://xxx.supabase.co/storage/v1/s3
SUPABASE_S3_REGIONrequired for uploadsus-east-1 (or your region)
SUPABASE_S3_ACCESS_KEY_IDrequired for uploadsFrom Supabase → Storage → S3 connection
SUPABASE_S3_SECRET_ACCESS_KEYrequired for uploadsFrom Supabase → Storage → S3 connection
SUPABASE_S3_BUCKETrequired for uploadsBucket name (default: storage)

Stripe (payments)

VariableRequired?Value
STRIPE_SECRET_KEYrequired for paymentsStripe → Developers → API keys → Secret key
STRIPE_WEBHOOK_SECRETrequired for paymentsStripe → Webhooks → endpoint → Signing secret
STRIPE_PRICE_ID_PREMIUMrequired for Premium planPrice ID from Stripe → Products → Premium
STRIPE_PRICE_ID_PARTNER_SUBSCRIPTIONoptionalRecurring price for sponsors
STRIPE_PRICE_ID_PROMO_BANNERoptionalMonthly price for banner ad
STRIPE_PRICE_ID_PROMO_CATALOGoptionalMonthly price for catalog card
STRIPE_PRICE_ID_PROMO_DETAILoptionalMonthly price for detail-page card
STRIPE_COUPON_ID_PROMO_ALL_THREEoptionalCoupon ID for "buy all three placements" discount

See Payments for the full Stripe setup.

Email (Resend)

VariableRequired?Value
RESEND_API_KEYrequired for emailResend → API Keys
RESEND_PRODUCTION_FROMoptionalOverride "From" in production (hello@yourdomain.com)
RESEND_DEV_FROMoptionalOverride "From" in dev (default: onboarding@resend.dev)
RESEND_FROM_EMAILoptionalMaster override for "From" — takes priority over the other two
RESEND_DEV_REDIRECToptionaltrue (default) redirects all dev emails to RESEND_DEV_REDIRECT_TO
RESEND_DEV_REDIRECT_TOoptionalEmail address for dev redirects — point to your own inbox

See Email Config.

Cron jobs

VariableRequired?Value
CRON_SECRETrequiredAny long random string. Example: openssl rand -hex 32. Protects /api/cron/* endpoints.

See Cron Jobs.

AI features (optional)

Only needed if ai: true in features.config.ts.

VariableValue
AI_PROVIDERopenai or anthropic
AI_MODELModel ID: gpt-4o-mini, claude-haiku-4-5, etc.
AI_API_KEYProvider API key

See AI Config.

Analytics (optional)

VariableValue
NEXT_PUBLIC_GA_MEASUREMENT_IDGA4 Measurement ID: G-XXXXXXXXXX
NEXT_PUBLIC_POSTHOG_KEYPostHog project API key (phc_...)
NEXT_PUBLIC_POSTHOG_HOSThttps://app.posthog.com or https://eu.posthog.com
NEXT_PUBLIC_GOOGLE_VERIFICATIONGoogle Search Console verification token

See Analytics Config.

Content & integrations (optional)

VariablePurpose
SEOBOT_API_KEYAI-written blog posts via SEObot
NEXT_PUBLIC_LOGO_DEV_TOKENAuto-fetch logos by domain with Logo.dev
NEXT_PUBLIC_LISTINGBOTT_URLExternal link on /pricing for ListingBott
NEXT_PUBLIC_MAPBOX_TOKENPublic Mapbox token (pk.…). Required only when the map feature is enabled. See Maps & Location.

Build & dev

VariableValue
ANALYZEtrue to enable webpack bundle analyzer (ANALYZE=true pnpm build)

Quick-copy starter

For local dev, minimum to run with auth + DB:

.env.local
NEXT_PUBLIC_APP_URL=http://localhost:3000
 
NEXT_PUBLIC_SUPABASE_URL=https://xxx.supabase.co
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=sb_publishable_...
SUPABASE_SECRET_KEY=sb_secret_...
 
CRON_SECRET=any-long-random-string

Add Stripe + Resend when you're ready to test payments + emails.

Adding env vars on Vercel

Let AI prep the production block for you first:

Paste them one by one, or drag-drop the .env.local file (Vercel parses it).

After changing env vars, trigger a redeploy — Vercel doesn't pick them up on existing builds.