Skip to content

Documentation / react-auth / useUpdateAccount

Function: useUpdateAccount()

useUpdateAccount(callbacks?): Object

Use this hook to update a users account and to attach callbacks for successful updateAccount, andupdateAccount errors.

Parameters

callbacks?: Object

callbacks.onError?: (error, details) => void

Callback that will execute in the case of a non-successful account linking.

Param {PrivyErrorCode} - the corresponding error code

Param {LoginMethod} - the type of (attempted) linked account

callbacks.onSuccess?: (user, updateMethod, updatedAccount) => void

Callback that will execute once on a successful updating of an account. This will run when any of the 'updateAccount' methods are called manually.

ParamUser- the user the account was linked to

Param [LoginMethod]([object Object])- the type of updated account

Param the newly updated account

Returns

Object

updateEmail - opens the Privy modal and prompts the user to update email

updatePhone - opens the Privy modal and prompts the user to update phone number

updateEmail

updateEmail: () => void

Returns

void

updatePhone

updatePhone: () => void

Returns

void