useExportAccount
Defined in: account-kit/react/src/hooks/useExportAccount.ts:68
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.
Example
import { function useExportAccount(args?: UseExportAccountMutationArgs): UseExportAccountResultA 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.
useExportAccount } from "@account-kit/react"; const { const exportAccount: UseMutateFunction<boolean, Error, void, unknown>exportAccount, const isExported: booleanisExported, const isExporting: booleanisExporting, const error: Error | nullerror, const ExportAccountComponent: (props: ExportAccountComponentProps) => JSX.ElementExportAccountComponent, } = function useExportAccount(args?: UseExportAccountMutationArgs): UseExportAccountResultA 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.
useExportAccount({ params?: ExportWalletParams | undefinedparams: { iframeContainerId: stringiframeContainerId: "my-iframe-container", }, });
Parameters
Returns
An object containing the export state, possible error, and the export account function and component. ref*