Skip to content

Environment

Locally, .env is generated from the running stack with pnpm env:local (--force overwrites an existing file). .env.example documents the same variables with the local defaults.

Name Used by Local Hosted
VITE_SUPABASE_URL Browser + server Supabase clients http://127.0.0.1:54321 https://<ref>.supabase.co
VITE_SUPABASE_PUBLISHABLE_KEY Browser + server Supabase clients local sb_publishable_… project’s publishable key
SUPABASE_SECRET_KEY Admin client (user management) — server only local sb_secret_… project’s secret key (secret)
DATABASE_URL Drizzle (pg pool) — server only postgresql://postgres:postgres@127.0.0.1:54322/postgres shared pooler, port 6543 (secret) — see Self-hosting
  • VITE_* values are inlined into the bundle at build time — change them, then redeploy. They’re public by design; never give a secret a VITE_ prefix.
  • Server-only variables are read inside functions (never at module scope).
  • pnpm start loads .env for local production runs; when hosted, the platform provides the variables.