How to add custom metadata in supabase signup action?

Hey, looking to add custom metadata during sign up.
I want to store stuff such as company name, first/last name.

I know I can create separate calls to create those stuff, but I dont want the user to end up in a state where they authenticated but for some reason they have no company / profile data.

Using the ‘Add Item’ works fine, but it doesnt allow for custom keys.

What is the format for the metadata array?
I tried those:

[ {"company": "test company"} ]

It seems the request works fine, but I get empty ‘raw_user_meta_data’ in supabase. It only seems to be populated when I pre-select from the list.

{ "data": [ {"company": "test company"} ] }
1 Like

Hi @AJAW :wave:

Great question!

Just updated the user docs with more options but basically, you need an array with an object for each item you want to add in the metadata where you explicitly say this is my key and this is the corresponding value for this item.

For example:

Does that work for you?

1 Like

Perfect! Exactly what I needed thank you.

It would be awesome btw if we could just add our own key/value pairs without the formula, it seems we are locked to the default keys such as ‘first name’, ‘gender’ etc.

1 Like

Yeaaah I think we looked into it and it’s due to a technical limitation but I’ll pass on the suggestion to the team

1 Like