create
Creates a new TOTP instance for the current user and returns the secret, QR code URL, and recovery codes. Calls the POST /sdk/v1/totps endpoint. The user should scan the QR code with their authenticator app, then call authenticate to verify setup.
Kotlin:
StytchConsumer.totps.create(TOTPsCreateParameters())Content copied to clipboard
iOS:
let params = TOTPsCreateParameters()
let response = try await StytchConsumer.totps.create(params)Content copied to clipboard
React Native:
StytchConsumer.totps.create({})Content copied to clipboard
Return
TOTPsCreateResponse containing the TOTP secret, qrCode URL, and recoveryCodes.
Parameters
request
ITOTPsCreateParameters
expirationMinutes?— Time before the TOTP setup expires if not verified, in minutes.
Throws
StytchError
if the request fails or the user already has an active TOTP instance.
if the coroutine is cancelled.