---
id: auth-updateuser
title: 'updateUser()'
slug: /auth-updateuser
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
---
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Updates user data, if there is a logged in user.
```js
const { data, error } = await supabase.auth.updateUser({
data: { hello: 'world' },
})
```
## Parameters
-
UserAttributes
required
object
No description provided.
## Notes
- In order to use the `updateUser()` method, the user needs to be signed in first.
- Email updates will send an email to both the user's current and new email with a confirmation link by default.
To only send a single confirmation link to the user's new email, you can toggle the "Secure email change" setting in [your project](https://app.supabase.com/project/_/auth/settings).
## Examples
### Update the email of an authenticated user
Sends a "Confirm Email Change" email to the new email address.
```js
const { data, error } = await supabase.auth.updateUser({
email: 'new@email.com',
})
```
### Update the password of an authenticated user
```js
const { data, error } = await supabase.auth.updateUser({
password: 'new password',
})
```
### Update the user's metadata.
```js
const { data, error } = await supabase.auth.updateUser({
data: { hello: 'world' },
})
```