Skip to main content

Prerequisites

Before this page: a signed-in user (see Email & SMS OTP sign-in).

What you’ll build

  • Display the current user’s profile.
  • Edit profile fields like name and username.
  • Verify a new email or phone number with a one-time code.
  • Delete the account.

Reading the profile

useUser returns a query result ({ data: user, ... }) that re-renders on any change — read the user from data. Outside React, read getDefaultClient().user.

Updating profile fields

updateUser accepts the fields you want to change. Most fields save immediately. Changing email or phone number returns an OTPVerification — prompt for the code and confirm it with verifyOTP.
Only send the fields you actually changed. Updatable fields include firstName, lastName, username, alias, email, phoneNumber, country, and metadata.

Deleting the account

Offer account deletion from settings. Confirm clearly first — it’s irreversible.

Handling errors

See also

  • Account merging — combine two accounts into one
  • Step-up authentication — require MFA before a profile update
  • Post-login user setup — collect required profile fields right after sign-in
Last modified on July 22, 2026