© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
3 replies
KrisGunnars

Trigger to update user metadata when some userdata fields update

Right now, I have Supabase setup with a trigger to create an entry in the "userdata" table whenever a new user signs up.

However, I want to also sync some properties from the userdata and into the auth metadata. For example, whether the user has a paid subscription or not.

How would I go about creating a trigger that updates the user's auth metadata when a field in the user's userdata table updates?

As in: If (userdata.plan) changes --> update user metadata.plan
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

How to read user_metadata inside trigger function when new user is created?
SupabaseSSupabase / help-and-questions
4y ago
user_metadata
SupabaseSSupabase / help-and-questions
4y ago
manually trigger onAuthStateChange USER_UPDATE event
SupabaseSSupabase / help-and-questions
3mo ago
error when inserting new user trigger
SupabaseSSupabase / help-and-questions
3y ago