Environment Variables
Configure Supasheet with environment variables
Required Variables
Supasheet needs exactly two environment variables — your Supabase project URL and its publishable key.
| Variable | Required | Purpose |
|---|---|---|
VITE_SUPABASE_URL | Yes | The base URL of your Supabase project |
VITE_SUPABASE_PUBLISHABLE_KEY | Yes | The 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:
VITE_SUPABASE_URL=http://127.0.0.1:54321
VITE_SUPABASE_PUBLISHABLE_KEY=sb_publishable_ACJWlzQHlZjBrEguHvfOxg_3BJgxAaHThe 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)
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
- Open supabase.com and sign in.
- Select your project.
- Go to Project Settings → API.
- Copy:
- Project URL →
VITE_SUPABASE_URL - Publishable key (formerly anon key) →
VITE_SUPABASE_PUBLISHABLE_KEY
- Project URL →
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/) viaSUPABASE_SERVICE_ROLE_KEY.
Next Steps
- Deployment — Deploy the static bundle to production
- Database Setup — Apply migrations on Supabase
- Production Checklist — Pre-launch sanity checks