Skip to content

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

Add an update example for gotrue

Paul Copplestone2e0b26a1c690
diff --git a/web/docs/gotrue/client/update.mdx b/web/docs/gotrue/client/update.mdx
index e029b0607dc..298d2cca5be 100644
--- a/web/docs/gotrue/client/update.mdx
+++ b/web/docs/gotrue/client/update.mdx
@@ -9,7 +9,31 @@ import TabItem from '@theme/TabItem';
Updates user data, if there is a logged in user.
+<Tabs
+ defaultValue="js"
+ groupId="libraries"
+ values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
+<TabItem value="js">
+
+```js
+const { user, error } = await auth.update({
+ data: { hello: 'world' }
+})
+```
+
+
+</TabItem>
+<TabItem value="py">
+
+```py
+# Not yet implemented
+```
+
+
+</TabItem>
+
+</Tabs>
## Parameters
@@ -36,4 +60,49 @@ No description provided.
</li>
-</ul>
\ No newline at end of file
+</ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Examples
+
+### Update a user's metadata.
+
+
+
+<Tabs
+ defaultValue="js"
+ groupId="libraries"
+ values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
+
+<TabItem value="js">
+
+```js
+const { user, error } = await auth.update({
+ data: { hello: 'world' }
+})
+```
+
+
+</TabItem>
+<TabItem value="py">
+
+```py
+# Not yet implemented
+```
+
+
+</TabItem>
+
+</Tabs>
\ No newline at end of file
diff --git a/web/spec/gotrue.yml b/web/spec/gotrue.yml
index 7291f80ccaa..d991fc91d48 100644
--- a/web/spec/gotrue.yml
+++ b/web/spec/gotrue.yml
@@ -131,6 +131,19 @@ pages:
update:
$ref: '"GoTrueClient".GoTrueClient.update'
+ examples:
+ - name: Update a user's metadata.
+ isSpotlight: true
+ js: |
+ ```js
+ const { user, error } = await auth.update({
+ data: { hello: 'world' }
+ })
+ ```
+ py: |
+ ```py
+ # Not yet implemented
+ ```
onAuthStateChange:
# $ref: onAuthStateChange