Skip to main content

Recommended: JavaScript SDK for React Native

While this SDK is still supported, we recommend using newer JavaScript SDK, which is optimized for React Native, but also comes with a host of other benefits.

Dashboard Setup

MFA enrollment requires users to register a TOTP device or Passkey. Configure it in the dashboard before implementing in your application. See End-User MFA - Enrollment for dashboard setup instructions.

Your UI SDK Implementation

  • Add device: Call client.mfa.addDevice(MFADeviceType.Totp) → show secret for manual entry.
    • Verify: client.mfa.verifyDevice(code, MFADeviceType.Totp) completes setup.
    • Manage devices: client.mfa.getUserDevices() lists devices.
    • Recovery codes: client.mfa.getRecoveryCodes(true) regenerates backup codes.
    Only one verified TOTP device per user
    • Recovery codes are single-use. Regenerate with client.mfa.getRecoveryCodes(true) if needed.
    Troubleshooting
    • Error: “401 Unauthorized” when adding a second TOTP device — only one device is supported; delete the existing device first.
    • Recovery codes not working — each code is single-use; generate new codes if exhausted.

Dynamic UI Implementation

The React Native SDK provides a UI method to prompt MFA authentication. Use client.ui.mfa.show() to open the MFA authentication flow. Note: The Dynamic UI is method-agnostic. It automatically prompts with whichever MFA method(s) you have enabled (TOTP only for React Native), so separate TOTP/Passkey tabs are not required here.
Optional: Create MFA token You can optionally request an MFA token by passing createMfaToken: true:

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

Show and hide specific MFA screens:
Last modified on July 24, 2026