Supasheet.

Environment Variables

Configure Supasheet with environment variables

Required Variables

Supasheet needs exactly two environment variables — your Supabase project URL and its publishable key.

VariableRequiredPurpose
VITE_SUPABASE_URLYesThe base URL of your Supabase project
VITE_SUPABASE_PUBLISHABLE_KEYYesThe publishable (anon) key used by the Supabase client

Both variables must be prefixed with VITE_ to be exposed to the Vite client bundle.

Development (.env)

For local development against npx supabase start:

.env
VITE_SUPABASE_URL=http://127.0.0.1:54321
VITE_SUPABASE_PUBLISHABLE_KEY=sb_publishable_ACJWlzQHlZjBrEguHvfOxg_3BJgxAaH

The default local publishable key matches the value printed by npx supabase start. Run npx supabase status if your local stack reports different values.

Production (.env)

.env.production
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_PUBLISHABLE_KEY=sb_publishable_…

Most hosts (Vercel, Netlify, Cloudflare Pages, Render, Fly) expose env vars through their dashboard rather than a checked-in file — set them there for production builds.

Getting Supabase Credentials

  1. Open supabase.com and sign in.
  2. Select your project.
  3. Go to Project Settings → API.
  4. Copy:
    • Project URLVITE_SUPABASE_URL
    • Publishable key (formerly anon key) → VITE_SUPABASE_PUBLISHABLE_KEY

Never put the service role key in a VITE_* variable. Service role belongs only inside Edge Functions (supabase/functions/), where it's read from SUPABASE_SERVICE_ROLE_KEY at runtime.

Notes

  • The Supabase publishable key is public by design — it's safe to commit, ship in the bundle, and share. Authorisation is enforced server-side by RLS policies, not by hiding this key.
  • All VITE_* values are inlined into the production JavaScript bundle, so anyone visiting your site can read them. That's fine for the URL and publishable key, but never for secrets.
  • The service role key is a different story — it bypasses RLS and must stay server-side. Use it only inside Edge Functions (supabase/functions/) via SUPABASE_SERVICE_ROLE_KEY.

Next Steps

On this page