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-ios and the usage docs here.
Add the package
Add the Stytch iOS package via Swift Package Manager. In Xcode, go to File → Add Package Dependencies and enter the repository URL:Select the StytchB2BSDK product and add it to your target.
Configure URL scheme
To handle magic links, register a custom URL scheme in your app’s Then pass this scheme as the
Info.plist:loginRedirectUrl and signupRedirectUrl when starting magic link flows, and handle the incoming URL in your AppDelegate or SceneDelegate by calling stytch.authenticate(url:).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.createStytchB2B return the same instance.