Dashboard Setup
- Go to the Security page.
- In the Action MFA section, enable your desired methods (TOTP and/or Passkeys).
- (Optional) Toggle “Require at onboarding” to force MFA setup during signup.
- Choose which events you want to protect with MFA and toggle them on.
Your UI SDK Implementation
- TOTP
- Passkey
- Check requirement: Use
useIsMfaRequiredForAction()
for the specific action. - Check token: Use
useGetMfaToken()
if MFA is required. - Create token: If missing, collect OTP and call
authenticateDevice({ code, createMfaToken })
. - Perform action: Token is applied automatically after creation.
- Only one verified TOTP device per user (device management applies across modes).
- Recovery codes are single-use; regenerate with
getRecoveryCodes(true)
if exhausted.
- Error: “MFA required” despite prompting — check
useGetMfaToken()
and attach token to backend requests. - Token unexpectedly missing — persistent tokens expire with session; create a new token when needed.
Dynamic UI Implementation
Note: The Dynamic UI is method-agnostic. It automatically prompts with whichever MFA method(s) you have enabled (TOTP and/or Passkeys). For action-based MFA, check if the specific action requires MFA and then open the Dynamic UI to create an MFA token.- usePromptMfaAuth hook to prompt the user to authenticate with MFA
- useIsMfaRequiredForAction hook to check if MFA is required for the action that the user is attempting to perform