StytchClient

The StytchClient object is your entrypoint to the Stytch Consumer SDK and is how you interact with all of our supported authentication products.

Properties

Link copied to clipboard

Exposes an instance of the Biometrics interface which provides methods for detecting biometric availability, registering, authenticating, and removing biometrics identifiers.

Link copied to clipboard
var bootstrapData: BootstrapData
Link copied to clipboard

Exposes an instance of the CryptoWallet interface which provides methods for authenticating with a crypto wallet

Link copied to clipboard
val dfp: DFP

Exposes an instance of the DFP interface which provides a method for retrieving a dfp_telemetry_id for use in DFP lookups on your backend server

Link copied to clipboard
Link copied to clipboard
val isInitialized: StateFlow<Boolean>
Link copied to clipboard

Exposes an instance of the MagicLinks interface whicih provides methods for sending and authenticating users with Email Magic Links.

Link copied to clipboard

Exposes an instance of the OAuth interface which provides methods for authenticating a user via a native Google OneTap prompt or any of our supported third-party OAuth providers

Link copied to clipboard
var otps: OTP

Exposes an instance of the OTP interface which provides methods for sending and authenticating One-Time Passcodes (OTP) via SMS, WhatsApp, and Email.

Link copied to clipboard

Exposes an instance of the Passkeys interface which provides methods for registering and authenticating with Passkeys.

Link copied to clipboard

Exposes an instance of the Passwords interface which provides methods for authenticating, creating, resetting, and performing strength checks of passwords.

Link copied to clipboard
lateinit var publicToken: String

The public token that the StytchClient is configured to use

Link copied to clipboard

Exposes an instance of the Sessions interface which provides methods for authenticating, updating, or revoking sessions, and properties to retrieve the existing session token (opaque or JWT).

Link copied to clipboard
var totp: TOTP

Exposes an instance of the TOTP interface which provides methods for creating, authenticating, and recovering TOTP codes

Link copied to clipboard

Exposes an instance of the UserManagement interface which provides methods for retrieving an authenticated user and deleting authentication factors from an authenticated user.

Functions

Link copied to clipboard
fun canHandle(uri: Uri): Boolean

A helper function for determining whether the deeplink is intended for Stytch. Useful in contexts where your application makes use of a deeplink coordinator/manager which requires a synchronous determination of whether a given handler can handle a given URL.

Link copied to clipboard
fun configure(context: Context, publicToken: String, callback: (Boolean) -> Unit = {})

This configures the API for authenticating requests and the encrypted storage helper for persisting session data across app launches. You must call this method before making any Stytch authentication requests.

Link copied to clipboard

Retrieve the most recently created PKCE code pair from the device, if available

Link copied to clipboard
suspend fun handle(uri: Uri, sessionDurationMinutes: UInt): DeeplinkHandledStatus
fun handle(uri: Uri, sessionDurationMinutes: UInt, callback: (response: DeeplinkHandledStatus) -> Unit)

Call this method to parse out and authenticate deeplinks that your application receives. The currently supported deeplink types are: Email Magic Links, Third-Party OAuth, and Password resets.