useExportAccount

A hook used to export the private key for an account. It returns the mutation functions to kick off the export process, as well as a component to render the account recovery details in an iframe. What is returned is dependent on what you used most recently used to authenticate. If your session was initiated with a passkey, then a private key is returned. Otherwise, a seed phrase.

Import

1import { useExportAccount } from "@account-kit/react";

Usage

1import { useExportAccount } from "@account-kit/react";
2
3const {
4 exportAccount,
5 isExported,
6 isExporting,
7 error,
8 ExportAccountComponent,
9} = useExportAccount({
10 params: {
11 iframeContainerId: "my-iframe-container",
12 },
13});

Parameters

args

UseExportAccountMutationArgs Optional arguments for the mutation and export parameters. ref

Returns

UseExportAccountResult An object containing the export state, possible error, and the export account function and component. ref*