Dashboard Setup
- Go to the Security page.
- In the Account MFA section, enable your desired methods (TOTP and/or Passkeys).
- (Optional) Toggle “Require at onboarding” to force MFA setup during signup.
- (Optional) Toggle “Session-based MFA” to require MFA for every new session.
Your UI SDK Implementation
- TOTP
- Passkey
- React
- React Native
- JavaScript SDK
- React Native
- Trigger gating: Check
userWithMissingInfo?.scopeforrequiresAdditionalAuth. - Detect MFA: Use
useSyncMfaFlowto know when to prompt. - Add device: Call
addDevice()→ show QR fromuri(installqrcode). - Verify:
authenticateDevice({ code })→ fetch and show recovery codes →completeAcknowledgement(). - Refresh: Call
getUserDevices()after verification.
- Recovery codes are single-use. Regenerate with
getRecoveryCodes(true)if needed.
- Error: “401 Unauthorized” when adding a second TOTP device — only one device is supported; delete the existing device first.
- QR code not displaying — ensure
qrcodeis installed:npm install qrcode @types/qrcode. - Recovery codes not working — each code is single-use; generate new codes if exhausted.
Dynamic UI Implementation
- React
- React Native
- JavaScript SDK
With the Dynamic UI, account-based MFA prompts appear automatically during onboarding/login when additional authentication is required. To explicitly trigger in your app, use
useSyncMfaFlow to detect the requirement and usePromptMfaAuth to open the UI.Note: The Dynamic UI is method-agnostic. It automatically prompts with whichever MFA method(s) you have enabled (TOTP and/or Passkeys), so separate TOTP/Passkey tabs are not required here.- useSyncMfaFlow hook to detect the requirement and open the Dynamic UI
- usePromptMfaAuth hook to prompt the user to authenticate with MFA
Programmatic MFA Modal Controls
Dynamic SDKs provide granular control over individual MFA modal screens. These methods allow you to programmatically show and hide specific MFA screens in your application.Available Modal Controls
- React Native
- React
Show and hide specific MFA screens: