StytchB2BClient

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

Properties

Link copied to clipboard

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

Exposes an instance of the Discovery interface which provides methods for creating and discovering Organizations and exchanging sessions between organizations

Link copied to clipboard

Exposes a flow that reports the initialization state of the SDK. You can use this, or the optional callback in the configure() method, to know when the Stytch SDK has been fully initialized and is ready for use

Link copied to clipboard

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

Link copied to clipboard

Exposes an instance of the Member interface which provides methods for retrieving the current authenticated user.

Link copied to clipboard

Exposes an instance of the OAuth interface which provides a method for starting and authenticating OAuth and OAuth Discovery flows

Link copied to clipboard

Exposes an instance of the Organization interface which provides methods for retrieving the current authenticated user's organization.

Link copied to clipboard

Exposes an instance of the OTP interface which provides a method for sending and authenticating OTP codes

Link copied to clipboard

Exposes an instance of the Passwords interface which provides methods for authenticating passwords, resetting passwords, and checking the strength of passwords

Link copied to clipboard

Exposes an instance of the RBAC interface which provides methods for checking a member's permissions

Link copied to clipboard

Exposes an instance of the RecoveryCodes interface which provides methods for getting, rotating, and recovering recovery codes

Link copied to clipboard

Exposes an instance of the SCIM interface which provides methods for creating, getting, updating, deleting, and rotating SCIM connections

Link copied to clipboard

Exposes an instance of the SearchManager interface which provides methods to search organizations and members

Link copied to clipboard

Exposes an instance of the B2BSessions 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

Exposes an instance of the SSO interface which provides methods for authenticating SSO sessions

Link copied to clipboard

Exposes an instance of the TOTP interface which provides a method for creating and authenticating TOTP codes

Functions

Link copied to clipboard

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)
fun configure(context: Context, publicToken: String, options: StytchClientOptions = StytchClientOptions())
fun configure(context: Context, publicToken: String, callback: (Boolean) -> Unit = {})
fun configure(context: Context, publicToken: String, options: StytchClientOptions = StytchClientOptions(), 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: Int): DeeplinkHandledStatus
fun handle(uri: Uri, sessionDurationMinutes: Int, callback: (response: DeeplinkHandledStatus) -> Unit)

Call this method to parse out and authenticate deeplinks that your application receives. The currently supported deeplink types are: B2B Email Magic Links.

Link copied to clipboard

Retrieve the token and a concrete token type from a deeplink