© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•2w ago•
8 replies
elektrosteve

SUPABASE_SERVICE_ROLE_KEY is reset locally on "supabase functions serve"

edge functions
When I run
supabase functions serve --env-file ./supabase/.env.local
supabase functions serve --env-file ./supabase/.env.local
locally and then invoke a function via HTTP,
Devo.get('SUPABASE_SERVICE_ROLE_KEY')
Devo.get('SUPABASE_SERVICE_ROLE_KEY')
will reveal a new value every time the "serve" command is executed again.

The JWT payload is always the same, just with a fresh
exp
exp
:

{
  "iss": "supabase-demo",
  "role": "service_role",
  "exp": 2084610768
}
{
  "iss": "supabase-demo",
  "role": "service_role",
  "exp": 2084610768
}


SUPABASE_SERVICE_ROLE_KEY
SUPABASE_SERVICE_ROLE_KEY
used to be stable. I assume that this has to do with the upcoming/ongoing keys migration, but I according to the migration timeline, the legacy approach should still be functional until late 2026.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

service_role key not working locally on rpc call
SupabaseSSupabase / help-and-questions
3y ago
Supabase service_role_key not bypassing RLS
SupabaseSSupabase / help-and-questions
4mo ago
SUPABASE_SERVICE_ROLE_KEY is different in Preview Branch
SupabaseSSupabase / help-and-questions
4w ago
How can I reset my service role key?
SupabaseSSupabase / help-and-questions
4y ago