© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
64 replies
izurugi

How to set claims on trigger supabase.

Hi, I'm trying to set the claims of newly registered user on supabase. I have figured I have to use trigger functions to set claims whether a new user is created/registered. Similar to handle_new_user function of user management starter in sql editor. I just thought of adding the line
select set_claim(new.id, 'claims_admin', 'true');
select set_claim(new.id, 'claims_admin', 'true');
inside the handle user function to set the claim/update claims of registered users. But, I'm getting error whenever newly registered with that line added. I'm not sure what's the issue, I can't tell if its type error or the new object is not yet being created.

https://github.com/supabase-community/supabase-custom-claims.
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
Next page

Similar Threads

Anyway to run EVENT TRIGGER on Supabase?
SupabaseSSupabase / help-and-questions
3y ago
Supabase Auth: why set supabaseResponse in setAll() again?
SupabaseSSupabase / help-and-questions
3mo ago
How to set Supabase session data for provider?
SupabaseSSupabase / help-and-questions
3y ago
Vercel + Supabase + Next. How to set up custom branching.
SupabaseSSupabase / help-and-questions
2mo ago