Session 1: Your platform, your accounts · element F00 · 5 minutes
Connect Supabase to Vercel, so nobody copies a key
Why
The website needs the database's address and keys. If a person copies them, they end up in chats, emails and laptops. Supabase's Vercel integration puts them straight into Vercel's protected settings and keeps them up to date, so the keys never pass through anyone's hands.
Do this
https://supabase.com/dashboard/project/abcdefghijklmnopqrst/settings/integrations
https://vercel.com/acme-ops/acme-platform/settings/environment-variables
On a new branch docs/keys, update docs/KEYS.md: add every environment variable name you can see with "npx vercel env ls" (names only, never values), what each unlocks, where it lives (Vercel, synced from Supabase by the integration), and who holds it (pat@acme.com and sam@acme.com). Mark any variable whose name contains SERVICE_ROLE or SECRET as "server only: must never be used in browser code". Open a pull request.
In the course these carry the learner's own names (here, the example company “Acme”).
You will see
| Key | Value | Environments |
|---|---|---|
| NEXT_PUBLIC_SUPABASE_URL | •••••••• | All |
| NEXT_PUBLIC_SUPABASE_ANON_KEY | •••••••• | All |
| SUPABASE_SERVICE_ROLE_KEY | •••••••• | All |
| POSTGRES_URL | •••••••• | All |
Check it worked
Vercel lists the Supabase variables, and docs/KEYS.md lists the same names with no values.
If it goes wrong
A variable is listed but the feature still fails, or an email never arrives
The value is there but wrong: on our Academy, a key's value turned out to be the variable's own name, pasted in by mistake. When you type a value into Vercel or GitHub, paste the value only, never NAME=value. Session 10 adds a start-up check that names any missing or malformed key without printing it.
Claude Code tries to open .env.local to read the keys
The deny rule from Step 10 blocks it, which is correct. Say: Use npx vercel env ls for names only.