Leave Localhost logoLeave LocalhostDocs
Reference

Environment Variables

A quick reference to every environment variable grouped by where it lives, with required values marked. See the Environment Variables guide for full descriptions.

A lookup table of all environment variables, grouped by where each one belongs. For full descriptions, defaults, and setup steps, see the narrative guide: Environment Variables. The environment doctor (bun check-env) validates these for you.

* marks a value that is required for the app to run.

Product app — apps/app/.env

Browser-exposed values are prefixed NEXT_PUBLIC_. The SENTRY_* build values are server-only.

VariableNotes
NEXT_PUBLIC_CONVEX_URL *Convex deployment URL.
NEXT_PUBLIC_CONVEX_SITE_URL *Convex HTTP actions URL (auth).
NEXT_PUBLIC_APP_URL *Canonical app metadata URL; auth client base and callbacks.
NEXT_PUBLIC_DOCS_URLOptional documentation destination for the product app; the Documentation links are hidden when unset.
NEXT_PUBLIC_ANALYTICS_ENABLEDtrue to enable browser analytics.
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENPostHog token (phc_…) when analytics on.
NEXT_PUBLIC_POSTHOG_HOSTPostHog host; defaults to US cloud.
NEXT_PUBLIC_SENTRY_DSNSentry client/server reporting.
NEXT_PUBLIC_AUTH_MICROSOFT_ENABLEDtrue to render the Microsoft sign-in button.
SENTRY_AUTH_TOKEN / SENTRY_ORG / SENTRY_PROJECTSentry sourcemap upload.

Marketing site — apps/marketing/.env

All public; the site builds with local defaults out of the box.

VariableNotes
NEXT_PUBLIC_SITE_URLCanonical marketing URL.
NEXT_PUBLIC_APP_URL"View demo" / app destination.
NEXT_PUBLIC_DOCS_URLDocumentation site link.
NEXT_PUBLIC_PURCHASE_URLOptional checkout URL (CTAs degrade gracefully if unset).
NEXT_PUBLIC_ANALYTICS_ENABLED / NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN / NEXT_PUBLIC_POSTHOG_HOSTAnalytics (optional).

Documentation site — apps/docs/.env

VariableNotes
NEXT_PUBLIC_DOCS_URLCanonical documentation URL.
NEXT_PUBLIC_SITE_URLExternal marketing-site destination.

Backend — Convex deployment

Set in the Convex dashboard (and packages/backend/.env for local tooling). These are never exposed to the browser.

GroupVariables
Identity *APP_NAME, SITE_URL, CONVEX_SITE_URL
Auth *BETTER_AUTH_SECRET, AUTH_GOOGLE_ID, AUTH_GOOGLE_SECRET
Auth (optional)AUTH_MICROSOFT_ID, AUTH_MICROSOFT_SECRET, AUTH_MICROSOFT_TENANT_ID, AUTH_TRUSTED_ORIGINS
BillingBILLING_PROVIDER, POLAR_*, STRIPE_*, LEMON_SQUEEZY_* (see Billing Plans)
EmailRESEND_API_KEY, RESEND_FROM_EMAIL, RESEND_AUTH_FROM_EMAIL, RESEND_WEBHOOK_SECRET
AnalyticsANALYTICS_ENABLED, POSTHOG_COMPONENT_ENABLED, POSTHOG_PROJECT_TOKEN, POSTHOG_HOST, POSTHOG_PERSONAL_API_KEY
AdminSUPER_ADMIN_EMAILS, SUPER_ADMIN_REQUIRE_2FA

On this page