JavaScript: Update a user

Updates user data for a logged in user.

Parameters

Examples

Update the email for an authenticated user

const \{ data, error \} = await supabase.auth.updateUser(\{
  email: 'new@email.com'
\})

Update the phone number for an authenticated user

const \{ data, error \} = await supabase.auth.updateUser(\{
  phone: '123456789'
\})

Update the password for an authenticated user

const \{ data, error \} = await supabase.auth.updateUser(\{
  password: 'new password'
\})

Update the user's metadata

const \{ data, error \} = await supabase.auth.updateUser(\{
  data: \{ hello: 'world' \}
\})

Update the user's password with a nonce

const \{ data, error \} = await supabase.auth.updateUser(\{
  password: 'new password',
  nonce: '123456'
\})