import.meta.env system for environment variables. All variables exposed to the browser must be prefixed with VITE_.
Copy .env.example to .env at the project root:
Environment Variables
The base URL of your Supabase project. Found in Supabase Dashboard → Project Settings → API → Project URL.
The anonymous (public) API key for your Supabase project. Found in Supabase Dashboard → Project Settings → API → Project API Keys →
anon public.This key is safe to expose in client-side code. Row Level Security (RLS) policies on every table enforce access control at the database level.
Data Source Name for Sentry error monitoring. When present, Sentry initializes automatically in production via Sentry is configured with:
initMonitoring() in main.tsx. Omit this variable entirely to disable Sentry.tracesSampleRate: 1.0— 100% of transactions tracedreplaysOnErrorSampleRate: 1.0— full session replay on every errorbrowserTracingIntegration+replayIntegration
Configuration Validation
src/lib/supabase.ts exports an isSupabaseConfigured boolean that checks both variables at module load time:
App.tsx renders an error screen instead of mounting the application:
Production: Cloudflare Pages
VSM Store is hosted on Cloudflare Pages at vsm-store.pages.dev. Environment variables are set in the Cloudflare dashboard, not in committed files.Open your Pages project
In the Cloudflare dashboard, go to Workers & Pages and select your VSM Store project.
Add variables for Production
Add each variable under the Production environment:
| Variable | Value |
|---|---|
VITE_SUPABASE_URL | Your Supabase project URL |
VITE_SUPABASE_ANON_KEY | Your Supabase anon key |
VITE_SENTRY_DSN | Your Sentry DSN (optional) |
Supabase Edge Function Secrets
The AI Edge Functions require additional secrets set directly on the Supabase project (not in.env):
