Environment Variable Lab
Public does not mean secret. Classify ten real examples.
daemoncore rule
Public does not mean secret.
A variable marked public isn't protected by anything — it is deliberately shipped to every visitor's browser. Marking a secret as public doesn't make it safe; it makes it published.
VITE_SUPABASE_URL=https://abc.supabase.co VITE_SUPABASE_PUBLISHABLE_KEY=sb_publishable_… STRIPE_SECRET_KEY=sk_live_…
Never committed. Listed in .gitignore. Every developer keeps their own.
VITE_SUPABASE_URL= VITE_SUPABASE_PUBLISHABLE_KEY= STRIPE_SECRET_KEY=
Names only, no values. It documents what a new developer must supply.
VITE_SUPABASE_URL ●●●●●● STRIPE_SECRET_KEY ●●●●●● (added per environment, then redeploy)
Your build server has never seen your .env file. This is where production gets its values.
where a secret is allowed to travel
browser
Public configuration only
Site URL, public keys, analytics IDs.
your server
Secrets live here
Read from environment at runtime, never sent down.
third party
Stripe · email · AI
Authenticated by the secret your server holds.
PUBLIC_SITE_URLVITE_SUPABASE_URLVITE_SUPABASE_PUBLISHABLE_KEYDATABASE_ADMIN_PASSWORDSTRIPE_SECRET_KEYSERVICE_ROLE_KEYNEXT_PUBLIC_ANALYTICS_IDSMTP_PASSWORDOPENAI_API_KEYPUBLIC_SUPPORT_EMAIL