Skip to content

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

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

Usage

import { AlchemyWebSigner } from "@account-kit/signer";
 
const signer = new AlchemyWebSigner({
  client: {
    connection: {
      rpcUrl: "/api/rpc",
    },
    iframeConfig: {
      iframeContainerId: "alchemy-signer-iframe-container",
    },
  },
});
 
const result = await signer.addMfa({ multiFactorType: "totp" });
// Result contains multiFactorTotpUrl to display as QR code

Parameters

params

EnableMfaParams The parameters required to enable a new MFA factor

Returns

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