Usage of user_metadata

Hey hey,

Just a general question. What would you use user_metadata for on the user in the auth schema? Comparing to usage of user data in e.g. a profiles table.

My main experience comes from frontend work and currently I'm working on a personal project where I'm using Supabase so I sometimes face these questions that I've never given much thought before.

This question popped up in connection with me setting up user sign up and onboarding. I want users to have a username in their profile which is fixed and used in routing for their profile page. My initial approach was to use the user_metadata to transfer information on the signup in the frontend to a trigger function in Supabase that fills out information in a profiles table. So I wanted to check and see if anyone has any tips & tricks or best practices.

This topic also made me think about things such as age/birthdate to only show age appropriate content as well - would such a thing be more appropriate in the user_metadata than in a profile for example?

I'm in a JS-environment on the frontend.
Was this page helpful?