useMFA

Hook that provides functions and state for managing multi-factor authentication (MFA) operations. Handles adding, verifying, removing, and getting MFA factors for an authenticated account.

The hook checks if the signer is connected before allowing MFA operations and provides an isReady flag to indicate whether MFA operations can be performed.

Import

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

Usage

import { 
function useMFA(): UseMFAResult

Hook that provides functions and state for managing multi-factor authentication (MFA) operations. Handles adding, verifying, removing, and getting MFA factors for an authenticated account.

The hook checks if the signer is connected before allowing MFA operations and provides an isReady flag to indicate whether MFA operations can be performed.

useMFA
} from "@account-kit/react";
const {
const addMFA: UseMutationResult<AddMfaResult, Error, AddMfaParams>
addMFA
,
const verifyMFA: UseMutationResult<{ multiFactors: MfaFactor[]; }, Error, VerifyMfaParams>
verifyMFA
,
const removeMFA: UseMutationResult<{ multiFactors: MfaFactor[]; }, Error, RemoveMfaParams>
removeMFA
,
const getMFAFactors: UseMutationResult<{ multiFactors: MfaFactor[]; }, Error, void>
getMFAFactors
,
const isReady: boolean
isReady
} =
function useMFA(): UseMFAResult

Hook that provides functions and state for managing multi-factor authentication (MFA) operations. Handles adding, verifying, removing, and getting MFA factors for an authenticated account.

The hook checks if the signer is connected before allowing MFA operations and provides an isReady flag to indicate whether MFA operations can be performed.

useMFA
();

Returns

UseMFAResult An object containing functions and state for handling MFA operations