Skip to content

Documentation / react-auth / useSetWalletRecovery

Function: useSetWalletRecovery()

useSetWalletRecovery(callbacks?): Object

Use this hook to set user-controlled recovery on the embedded wallet, and to attach callbacks for successful recovery sets, and recovery set errors. Note that the callbacks will only fire for explicit setWalletRecovery calls from the Privy SDK.

Parameters

callbacks?: Object

callbacks.onError?: (error) => void

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

Param {PrivyErrorCode} - the corresponding error code

callbacks.onSuccess?: (method, wallet) => void

Callback that will execute once a successful setWalletRecovery completes.

ParamWallet- the walle]et object that the recovery was set for

Returns

Object

setWalletRecovery - opens the Privy modal and prompts the user to set a password on the embedded wallet

setWalletRecovery

setWalletRecovery: () => Promise<Wallet>

Returns

Promise<Wallet>