For AI agents: the documentation index is at llms.txt. Guide pages have a markdown version at the same path with .md appended, before any query string or fragment.

Swift: Update a user

Examples

Update the email for an authenticated user

try await supabase.auth.updateUser(
  UpdateUser(email: "new@email.com"),
  redirectTo: URL(string: "my-app-scheme://callback")!
)

Update the phone number for an authenticated user

try await supabase.auth.updateUser(
  UpdateUser(phone: "123456789")
)

Update the password for an authenticated user

try await supabase.auth.updateUser(UpdateUser(password: "newPassw0rd?"))

Update the user's metadata

try await supabase.auth.updateUser(
  UpdateUser(
    userMetadata: [
      "hello": .string("world")
    ]
  )
)

Update the user's password with a nonce

try await supabase.auth.updateUser(
  UpdateUser(
    password: "new password",
    nonce: "123456"
  )
)