Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Add section on managing metadata (#12504)

Joel Lee6ce5705b6e3f
diff --git a/apps/docs/pages/guides/auth/managing-user-data.mdx b/apps/docs/pages/guides/auth/managing-user-data.mdx
index bd5ae4f7db7..462f160b238 100644
--- a/apps/docs/pages/guides/auth/managing-user-data.mdx
+++ b/apps/docs/pages/guides/auth/managing-user-data.mdx
@@ -87,6 +87,32 @@ If you need to fetch a full list of user profiles, we supply a `service_key` whi
Make sure you _NEVER_ expose this publicly. But it can be used on the server-side to fetch all of the profiles.
+## Accessing User Metadata
+
+You can assign metadata to users on sign up:
+
+```js
+const { data, error } = await supabase.auth.signUp({
+ email: '[email protected]',
+ password: 'example-password',
+ options: {
+ data: {
+ first_name: 'John',
+ age: 27,
+ },
+ },
+})
+```
+
+User metadata is stored on the `raw_user_meta_data` column of the `auth.users` table. To view the metadata:
+
+```js
+const {
+ data: { user },
+} = await supabase.auth.getUser()
+let metadata = user.user_metadata
+```
+
## Advanced techniques
### Using triggers