Environment Variables Reference
Repo-accurate environment variable guidance.
This repo reads environment variables through standard Node/Next.js env loading plus next-runtime-env for public runtime values.
Practical Repo Guidance
- keep local secrets in
./.env.local - use hosting-provider environment variables in production
- treat
apps/web/config/*.tsas the source of truth for app-level config parsing
Key config files:
apps/web/config/app.config.tsapps/web/config/auth.config.tsapps/web/config/account-mode.config.tsapps/web/config/feature-flags.config.ts
Common Variables
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgresBETTER_AUTH_SECRET=replace-meNEXT_PUBLIC_SITE_URL=http://localhost:3000NEXT_PUBLIC_PRODUCT_NAME=My AppNEXT_PUBLIC_DEFAULT_LOCALE=enNEXT_PUBLIC_DEFAULT_THEME_MODE=lightNEXT_PUBLIC_ACCOUNT_MODE=hybridAuth
NEXT_PUBLIC_AUTH_PASSWORD=trueNEXT_PUBLIC_AUTH_MAGIC_LINK=falseNEXT_PUBLIC_AUTH_OAUTH_PROVIDERS=googleNEXT_PUBLIC_DISPLAY_TERMS_AND_CONDITIONS_CHECKBOX=falseTURNSTILE_SECRET_KEY=NEXT_PUBLIC_CAPTCHA_SITE_KEY=Billing
Billing configuration also depends on:
packages/billing/config/src/config.ts- provider-specific keys for Stripe or Polar
Monitoring
NEXT_PUBLIC_MONITORING_PROVIDER=sentryNEXT_PUBLIC_SENTRY_DSN=NEXT_PUBLIC_SENTRY_ENVIRONMENT=MAILER_PROVIDER=nodemailerEMAIL_SENDER=My App <noreply@example.com>EMAIL_HOST=EMAIL_PORT=EMAIL_TLS=EMAIL_USER=EMAIL_PASSWORD=RESEND_API_KEY=Runtime Public Env
Client-side code should read public runtime variables with:
import { env } from '@kit/shared/env';Server-side code can use process.env.
Important Constraint
Do not assume the repo ships committed ./.env.local, ./.env.local, or ./.env.local files. Use ./.env.local locally and your deployment platform in production.