Embedded (WaaS) wallets stay recoverable through a backup of their cryptographic key shares. The React SDK exposed this through widget screens — a “back up your wallet” step and a “reveal private key” view. The JavaScript SDK gives you the same operations as functions and hooks so you can place them in your own settings UI.
Building the backup and export screens is the same in any JavaScript SDK app, so it isn’t repeated here: Wallet backup & recovery (Building UI) covers readiness, the Google Drive backup, and the secure key export with full code. This page is the React→JavaScript translation plus the migration-specific behavior.
What maps to what
Migration-specific behavior
- Readiness is yours to check.
getWalletRecoveryState({ walletAccount }) returns walletReadyState ('ready' / 'encrypted') and isPasswordEncrypted (whether a password protects the share). Prompt to set a password when isPasswordEncrypted is false, or to unlock when walletReadyState is 'encrypted', before backing up. walletReadyState is a plain string — there’s no publicly exported WalletReadyState enum.
- Backup gates on a Google scope check. A backup spends an MPC reshare ceremony, so call
getGoogleDriveBackupReadiness() first: on status: 'needs-access' have the user re-link their Google account to grant the missing Drive scopes (missingScopes) before backupWaasKeySharesToGoogleDrive().
- Export runs in a secure iframe.
exportWaasPrivateKey() renders the key inside an SDK-injected iframe in a container you provide — the key never touches your DOM. Pass the wallet password when the project requires one.
The private key grants full control of the wallet. Only trigger export behind a deliberate user action and never log or copy the value yourself — the secure iframe keeps it out of your application’s reach.
Errors you now own
See also