sdk.mfa - Multi-Factor Authentication
getUserDevices
Get all MFA devices for the authenticated user.
Returns
List<MfaDevice> - List of MFA devices
Example
addDevice
Add a new MFA device (TOTP authenticator).
Parameters
- type (String) - The device type (typically “totp” for authenticator apps)
Returns
- MfaAddDevice - Device information including the secret for QR code generation
Example
verifyDevice
Verify a newly added MFA device with a TOTP code.
Parameters
- code (String) - The 6-digit TOTP code from the authenticator app
- type (String) - The device type (typically “totp”)
Example
authenticateDevice
Authenticate with an MFA device to get an MFA token.
Parameters
- params (MfaAuthenticateDevice) - Authentication parameters:
code (String) - The TOTP code
deviceId (String) - The device ID
createMfaToken (MfaCreateToken) - Token creation parameters
Returns
- String? - The MFA authentication token
Example
deleteUserDevice
Delete an MFA device. Requires an MFA authentication token.
Parameters
- deviceId (String) - The ID of the device to delete
- mfaAuthToken (String) - MFA token obtained from
authenticateDevice
Example
getRecoveryCodes
Get recovery codes for MFA. Optionally generate new codes.
Parameters
- generateNewCodes (Boolean) - Whether to generate new recovery codes (default: false)
Returns
List<String> - List of recovery codes
Example
acknowledgeRecoveryCodes
Mark recovery codes as shown to the user.
Example
authenticateRecoveryCode
Authenticate using a recovery code.
Parameters
- code (String) - The recovery code
Example
sdk.passkeys - Passkey Management
getPasskeys
Get all passkeys for the authenticated user.
Returns
List<UserPasskey> - List of user passkeys
Example
registerPasskey
Register a new passkey using the device’s biometric authentication.
Example
authenticatePasskeyMFA
Authenticate with a passkey for MFA purposes, generating an MFA token.
Parameters
- createMfaToken (MfaCreateToken) - Token creation parameters
- relatedOriginRpId (String?) - Optional Relying Party ID (RP ID) for authenticating from a related origin. The canonical form is a bare hostname such as
my.example.com; a full origin like https://my.example.com is also accepted and resolves to the same RP ID. It must match the rpId the credential was registered under. Typically null.
Returns
- PasskeyAuthenticationResponse - Response containing JWT token
Example
deletePasskey
Delete a passkey.
Parameters
- request (DeletePasskeyRequest) - Request containing the passkey ID
Example
Data Types
MfaDevice
MfaAuthenticateDevice
MfaCreateToken
UserPasskey
DeletePasskeyRequest
PasskeyAuthenticationResponse
Last modified on July 17, 2026