Environment Variables
Copy .env.example to .env.local and fill in the values.
Required Variables
| Variable | Description | Where to Get It |
|---|
NEXT_PUBLIC_SUPABASE_URL | Supabase project URL | Supabase Dashboard > Settings > API |
NEXT_PUBLIC_SUPABASE_ANON_KEY | Supabase anonymous/public key | Supabase Dashboard > Settings > API |
Optional Variables
| Variable | Description | When Needed |
|---|
SUPABASE_SERVICE_ROLE_KEY | Supabase admin key (bypasses RLS) | E2E test user setup, admin scripts |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | Stripe public key (test mode) | Billing features |
STRIPE_SECRET_KEY | Stripe secret key (test mode) | Billing API calls |
STRIPE_WEBHOOK_SECRET | Stripe webhook signing secret | Processing Stripe events |
TEST_USER_EMAIL | E2E test user email | Running Playwright tests |
TEST_USER_PASSWORD | E2E test user password | Running Playwright tests |
Example .env.local
# Supabase (required)
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIs...
# Supabase Admin (optional)
SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIs...
# Stripe (optional - only for billing features)
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
# E2E Testing (optional)
TEST_USER_EMAIL=e2e.test.hostmetrics@gmail.com
TEST_USER_PASSWORD=E2ETestPassword123!
Never commit .env.local to git. It’s already in .gitignore. The SUPABASE_SERVICE_ROLE_KEY and STRIPE_SECRET_KEY are sensitive — never expose them in client-side code.
Vercel Deployment Variables
When deploying to Vercel, add these same variables in your Vercel project settings under Settings > Environment Variables. Use production Supabase and Stripe keys (not test keys) for the production environment.