Package-level declarations

Stytch's B2B SDK makes it simple to seamlessly onboard, authenticate, and engage users. This SDK provides the easiest way for you to use Stytch on Android. With just a few lines of code, you can easily authenticate your users and get back to focusing on the core of your product.

Supported Authentication Products

  • magicLinks

    • Send/authenticate magic links via Email

  • sessions

    • Authenticate/refresh an existing session

    • Revoke a session (Sign out)

  • member

    • Get or fetch the current user object (sync/cached or async options available)

  • organization

    • Get or fetch the current user's organization

Using the B2B SDK

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

Each endpoint is explained in their respective READMEs and inline-documentation, but there are a few special methods on the StytchB2BClient object to document here.

Configuration

As mentioned in the /README.md, before making any Stytch authentication requests, you must configure the StytchB2BClient:

StytchB2BClient.configure(context: Context, publicToken: String)

This configures the API for authenticating requests and the encrypted storage helper for persisting session data across app launches.

Handling Deeplinks

StytchB2BClient.handle() is the method you call for parsing out and authenticating deeplinks that your application receives. The currently supported deeplink types are: B2B Email Magic Links. This method returns a ../common/DeeplinkHandledStatus.kt class which details the result of the authentication call.

For B2B Email Magic Links, it will return a Handled class containing either the authenticated response or error.

Any other link types passed to this method will return a NotHandled class.

Types

Link copied to clipboard
typealias B2BSearchMemberResponse = StytchResult<B2BSearchMemberResponseData>
Link copied to clipboard
typealias B2BSearchOrganizationResponse = StytchResult<B2BSearchOrganizationResponseData>
Link copied to clipboard
typealias B2BSSODeleteConnectionResponse = StytchResult<B2BSSODeleteConnectionResponseData>
Link copied to clipboard
typealias B2BSSOGetConnectionsResponse = StytchResult<B2BSSOGetConnectionsResponseData>
Link copied to clipboard
typealias B2BSSOOIDCCreateConnectionResponse = StytchResult<B2BSSOOIDCCreateConnectionResponseData>
Link copied to clipboard
typealias B2BSSOOIDCUpdateConnectionResponse = StytchResult<B2BSSOOIDCUpdateConnectionResponseData>
Link copied to clipboard
typealias B2BSSOSAMLCreateConnectionResponse = StytchResult<B2BSSOSAMLCreateConnectionResponseData>
typealias B2BSSOSAMLDeleteVerificationCertificateResponse = StytchResult<B2BSSOSAMLDeleteVerificationCertificateResponseData>
Link copied to clipboard
typealias B2BSSOSAMLUpdateConnectionByURLResponse = StytchResult<B2BSSOSAMLUpdateConnectionByURLResponseData>
Link copied to clipboard
typealias B2BSSOSAMLUpdateConnectionResponse = StytchResult<B2BSSOSAMLUpdateConnectionResponseData>
Link copied to clipboard

An enum representing the supported (B2B) token types that we can extract from a deeplink

Link copied to clipboard
typealias BasicResponse = StytchResult<BasicData>
Link copied to clipboard
typealias CreateMemberResponse = StytchResult<MemberResponseCommonData>
Link copied to clipboard
typealias DeleteMemberAuthenticationFactorResponse = StytchResult<MemberDeleteAuthenticationFactorData>

Type alias for StytchResult used for MemberDeleteAuthenticationFactor responses

Link copied to clipboard
typealias DeleteMemberResponse = StytchResult<OrganizationMemberDeleteResponseData>
Link copied to clipboard
typealias DeleteOrganizationResponse = StytchResult<OrganizationDeleteResponseData>
Link copied to clipboard
typealias DiscoverOrganizationsResponse = StytchResult<DiscoveredOrganizationsResponseData>

Type alias for StytchResult used for discovery.organizations() responses

Link copied to clipboard
typealias DiscoveryEMLAuthResponse = StytchResult<DiscoveryAuthenticateResponseData>

Type alias for StytchResult used for magicLinks.discovery.authenticate() responses

Link copied to clipboard
typealias EmailResetResponse = StytchResult<EmailResetResponseData>

Type alias for StytchResult used for passwords.resetByEmail() responses

Link copied to clipboard
typealias EMLAuthenticateResponse = StytchResult<B2BEMLAuthenticateData>
Link copied to clipboard
typealias IntermediateSessionExchangeResponse = StytchResult<IntermediateSessionExchangeResponseData>

Type alias for StytchResult used for discovery.exchangeSession() responses

Link copied to clipboard
typealias MemberResponse = StytchResult<MemberResponseData>

Type alias for StytchResult used for member.get() responses

Link copied to clipboard
typealias MemberSearchResponse = StytchResult<MemberSearchResponseData>
Link copied to clipboard
typealias OAuthAuthenticateResponse = StytchResult<OAuthAuthenticateResponseData>
Link copied to clipboard
typealias OAuthDiscoveryAuthenticateResponse = StytchResult<DiscoveryAuthenticateResponseData>
Link copied to clipboard
typealias OrganizationCreateResponse = StytchResult<OrganizationCreateResponseData>

Type alias for StytchResult used for discovery.create() responses

Link copied to clipboard
typealias OrganizationResponse = StytchResult<OrganizationResponseData>

Type alias for StytchResult used for organization.get() responses

Link copied to clipboard
typealias PasswordResetByExistingPasswordResponse = StytchResult<PasswordResetByExistingPasswordResponseData>
Link copied to clipboard
typealias PasswordsAuthenticateResponse = StytchResult<PasswordsAuthenticateResponseData>
Link copied to clipboard
typealias PasswordStrengthCheckResponse = StytchResult<StrengthCheckResponseData>

Type alias for StytchResult used for passwords.strengthCheck() responses

Link copied to clipboard
typealias ReactivateMemberResponse = StytchResult<MemberResponseCommonData>
Link copied to clipboard
typealias RecoveryCodesGetResponse = StytchResult<RecoveryCodeGetResponseData>
Link copied to clipboard
typealias RecoveryCodesRecoverResponse = StytchResult<RecoveryCodeRecoverResponseData>
Link copied to clipboard
typealias RecoveryCodesRotateResponse = StytchResult<RecoveryCodeRotateResponseData>
Link copied to clipboard
typealias SessionExchangeResponse = StytchResult<SessionExchangeResponseData>

Type alias for StytchResult used for session.exchange() responses

Link copied to clipboard
typealias SessionResetResponse = StytchResult<SessionResetResponseData>

Type alias for StytchResult used for passwords.resetBySession() responses

Link copied to clipboard
typealias SessionsAuthenticateResponse = StytchResult<SessionsAuthenticateResponseData>
Link copied to clipboard
typealias SMSAuthenticateResponse = StytchResult<SMSAuthenticateResponseData>
Link copied to clipboard
typealias SSOAuthenticateResponse = StytchResult<SSOAuthenticateResponseData>

Type alias for StytchResult used for sso.authenticate() responses

Link copied to clipboard

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

Link copied to clipboard
typealias TOTPAuthenticateResponse = StytchResult<TOTPAuthenticateResponseData>
Link copied to clipboard
typealias TOTPCreateResponse = StytchResult<TOTPCreateResponseData>
Link copied to clipboard
typealias UpdateMemberResponse = StytchResult<UpdateMemberResponseData>

Type alias for StytchResult used for UpdateMember responses

Link copied to clipboard
typealias UpdateOrganizationMemberResponse = StytchResult<MemberResponseCommonData>
Link copied to clipboard
typealias UpdateOrganizationResponse = StytchResult<OrganizationUpdateResponseData>