Package com.stytch.sdk.consumer.otp
The OTP.kt interface provides methods for sending and authenticating One-Time Passcodes (OTP) via SMS, WhatsApp, and Email.
Call the StytchClient.otp.[PLATFORM].loginOrCreate() method (for your desired platform: sms, whatsapp, or email) to send a one-time passcode (OTP) to a user using their phone number or email address. If the phone number or email address is not associated with a user already, a user will be created. Make sure to persist the returned phone or email ID for use when authenticating an OTP.
Call the StytchClient.otp.[PLATFORM].send() method (for your desired platform: sms, whatsapp, or email) to send a one-time passcode (OTP) to an existing user using their phone number or email address. Make sure to persist the returned phone or email ID for use when authenticating an OTP.
Call the StytchClient.otp.authenticate() method to authenticate a provided OTP. Remember to include the phone or email ID returned from the loginOrCreate() or send() response.
See: Description
-
Class Summary Class Description AuthParameters Data class used for wrapping parameters used with OTP authentication Parameters Data class used for wrapping parameters used with SMS OTP Parameters Data class used for wrapping parameters used with WhatsApp OTP Parameters Data class used for wrapping parameters used with Email OTP -
Interface Summary Interface Description SmsOTP Provides all possible ways to call SMS OTP endpoints WhatsAppOTP Provides all possible ways to call WhatsApp OTP endpoints EmailOTP Provides all possible ways to call Email OTP endpoints OTP The OTP interface provides methods for sending and authenticating One-Time Passcodes (OTP) via SMS, WhatsApp, and Email.