© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•7mo ago•
4 replies
Smokey

Using service role in Edge Function

I assumed that using Admin role inside Edge Function was perfectly safe. I was treating it like I was creating a private API route like I usually would in Python. I see no reason why I can't do everything with an admin role, if I am vetting the input data the request receives.

But out of curiosity, I asked claude to review one of my edge functions, and was told I should very rarely use a service role in edge functions. I just can't see why not.

Can someone explain to me why I shouldn't?
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

Checking role in edge function
SupabaseSSupabase / help-and-questions
4y ago
Edge Function cannot insert into table with RLS even using Service Role Key
SupabaseSSupabase / help-and-questions
5mo ago
Error when insert in table "profiles" with edge-function and SERVICE_ROLE_KEY
SupabaseSSupabase / help-and-questions
8mo ago
Cannot access new service role API key from Edge Function runtime
SupabaseSSupabase / help-and-questions
3mo ago