addMfa

Initiates the setup of a new MFA factor for the current user. The factor will need to be verified using verifyMfa before it becomes active.

Import

1import { BaseAlchemySigner } from "@account-kit/signer";

Usage

1import { AlchemyWebSigner } from "@account-kit/signer";
2
3const signer = new AlchemyWebSigner({
4 client: {
5 connection: {
6 rpcUrl: "/api/rpc",
7 },
8 iframeConfig: {
9 iframeContainerId: "alchemy-signer-iframe-container",
10 },
11 },
12});
13
14const result = await signer.addMfa({ multiFactorType: "totp" });
15// Result contains multiFactorTotpUrl to display as QR code

Parameters

params

AddMfaParams The parameters required to enable a new MFA factor

Returns

Promise<AddMfaResult> A promise that resolves to the factor setup information