Migrating production infrastructure? Get up to ₹10,000 in migration credits. Apply now
voroaBlog
PostgreSQL

Supabase API Keys: anon and service_role Retire in Early 2027

· · 3 min read

Supabase API keys - legacy anon and service_role keys are deprecated in early 2027

Supabase API keys are changing. The legacy anon and service_role keys are being deprecated in early 2027, replaced by new publishable and secret keys.

The date has already moved once - earlier announcements said late 2026 - so it may move again. The work does not depend on the date, though, and doing it calmly now beats doing it in a rush in the new year.

Advertisement

What Supabase says

Supabase’s guide to migrating to the new API keys sets out the change:

  • Publishable key replaces anon. It is safe to ship in a browser or mobile app, like anon was.
  • Secret key replaces service_role. It bypasses row-level security and must stay on a server.
  • The new keys are not JWTs. They are short strings. The legacy anon key was a long-lived JWT.
  • Legacy keys keep working until you disable them yourself in the dashboard’s API Keys settings - or until Supabase removes them in early 2027.

A related change landed earlier: since 8 April 2026, the Data API no longer returns its OpenAPI spec to requests made with the anon key.

Diagram: Supabase API key change - anon becomes publishable, service_role becomes secret, legacy keys work until you disable them

The order that avoids downtime

  1. Create the new keys in the dashboard. Both old and new now work side by side.
  2. Servers first. Replace service_role with the secret key in every backend, cron job and worker. Redeploy each one.
  3. Web frontends next. Swap anon for the publishable key and redeploy.
  4. Mobile apps last, and carefully (see below).
  5. Disable the legacy keys only when logs show no traffic using them.

If any code decodes the anon key as a JWT - to read its expiry, for example - that code breaks with the new keys. Search for it before step 3.

The mobile-app trap for Indian audiences

A web app updates the moment you deploy. A mobile app does not: the old build, with the anon key compiled in, stays on phones until the user updates. In India, many phones are short on storage or on metered data, and auto-update is often off, so an old build can stay in use for months. Ship the app update with the publishable key now, and wait until your analytics show old versions have faded before you disable the legacy key. Disabling it early breaks the app - every request from the old build fails - for exactly the users least likely to update. Two practical guards help: show an in-app “please update” prompt when a newer version exists, and log the app version (on your backend or in your analytics) so you can see the old builds fade instead of guessing.

If the migration makes you rethink the setup

Supabase bundles a Postgres database with an API layer and keys in front of it. Some teams only use the database, and every key change is overhead for features they do not use. Voroa managed PostgreSQL is plain Postgres, in Mumbai by default: your server connects with a normal database URL stored as an environment variable, and Auth is available on the database if you need sign-up and login. The managed databases guide covers creating one.

For the wider comparison, read our Supabase alternative for India and Supabase pricing in rupees.

Advertisement