This guide is for our new Kotlin Multiplatform SDK which is in Public beta. If you are instead looking for the stable version, please see stytch-android and the usage docs here.
1
Add the dependency
Add the Stytch Consumer SDK to your The SDK is published to Maven Central. Make sure
build.gradle.kts:mavenCentral() is in your repository list.2
Configure deep link handling
To handle magic links, register a custom URL scheme in your Pass this scheme as the
AndroidManifest.xml:loginRedirectUrl and signupRedirectUrl when starting magic link flows.3
Create the Stytch client
Initialize the Stytch client with your Project’s The client is a singleton — subsequent calls to
public_token from the Project Overview of the Stytch Dashboard.createStytchConsumer with the same process return the same instance.4
Observe authentication state
Subscribe to
authenticationStateFlow to react to sign-in and sign-out events: