function initiateMfaEnrollment(options: InitiateMfaOptions): Promise<InitiateMfaEnrollmentResult>;
Initiates MFA enrollment for an end user.For TOTP, this generates a TOTP secret and returns an otpauth:// URL that can be scanned
with an authenticator app like Google Authenticator. The secret must be verified within
5 minutes by calling submitMfaEnrollment.For SMS, this sends a 6-digit OTP code to the provided phone number. The OTP code must
be verified within 5 minutes. You can use any phone number for SMS MFA, even if it differs
from your SMS authentication phone number.
// TOTP enrollmentconst totpResult = await initiateMfaEnrollment({ mfaMethod: "totp" });// Display totpResult.authUrl as QR code or provide totpResult.secret for manual entryconsole.log("Scan this QR code:", totpResult.authUrl);console.log("Or enter this secret manually:", totpResult.secret);// SMS enrollmentconst smsResult = await initiateMfaEnrollment({ mfaMethod: "sms", phoneNumber: "+14155552671"});console.log("SMS sent:", smsResult.success);// User receives SMS with 6-digit code