Keys / Supabase
SUPABASE_ANON_KEY
The legacy Supabase key for browser and mobile code. It's meant to be public; Row Level Security decides what it reaches.
- Starts with
eyJ- Expires
- long-lived; deprecated by the end of 2026
- API
- list, and turn legacy keys off or on, with an access token; no create
Get it
Create one on supabase.com/dashboard/project/_/settings/api-keys. The steps aren't recorded yet.
Set it
SUPABASE_ANON_KEY=eyJ...
No Supabase SDK reads it on its own; your app passes it to createClient. Edge Functions get it in their environment. Or keep it out of .env with keypin: keypin run -- npm run dev
Replace it
- Supabase replaces
anonwith publishable keys. Create one in Settings > API Keys; it starts withsb_publishable_. - Use it everywhere that uses
SUPABASE_ANON_KEY, including app versions people already installed. - Edge Functions can't set
SUPABASE_variables, so change them to read the key fromSUPABASE_PUBLISHABLE_KEYSand deploy them. - Turning legacy keys off turns off
service_roletoo, so move server code to a secret key first. - Check that nothing still uses the legacy keys, then turn them off in Settings > API Keys. You can turn them back on.
Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.