Skip to main content
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.
For a full walk-through of how to get up and running with a sign-up and login flow using Stytch, check out our Quickstart Guide.
1

Add the dependency

Add the Stytch Consumer SDK to your build.gradle.kts:
The SDK is published to Maven Central. Make sure mavenCentral() is in your repository list.
2

Configure deep link handling

To handle magic links, register a custom URL scheme in your AndroidManifest.xml:
Pass this scheme as the loginRedirectUrl and signupRedirectUrl when starting magic link flows.
3

Create the Stytch client

Initialize the Stytch client with your Project’s public_token from the Project Overview of the Stytch Dashboard.
The client is a singleton — subsequent calls to 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: