Skip to main content

Retrieve Recovery Information

To retrieve the recovery information for a wallet, you can use the getRecoveryInfo method.

const recoveryInfo = await wallet.getRecoveryInformation();

Usage

import { EmbeddedWallet } from "@thirdweb-dev/wallets";

const wallet = new EmbeddedWallet();
await wallet.connect();
const recoveryInfo = await wallet.getRecoveryInformation();

Connect using recovery code

If the user is an existing user, you can optionally enter a recovery code. This is a code that was generated when they first signed up. It is used to recover their account if they lose access to their device:

import { EmbeddedWallet } from "@thirdweb-dev/wallets";

const embeddedWallet = new EmbeddedWallet();

// make sure to call this after a user event - button click etc.
await embeddedWallet.connect({
loginType: "headless_email_otp_verification",
email: "<email-address";
otp: "<an-otp>";
recoveryCode: "<recovery-code>";
});