Migration Guide: @stytch/react-native → stytch-mobile (React Native)
Our new Kotlin Multiplatform SDK is still in Public beta. If you’re looking for a stable version, we recommend
using our
@stytch/react-native package for the time being.@stytch/react-native (the original TypeScript-based RN SDK) to @stytch/react-native-consumer / @stytch/react-native-b2b (the new Kotlin Multiplatform-backed SDK).
What Changed at a Glance
New Architecture Requirement
The new SDK uses React Native’s New Architecture (TurboModules), which is the default in RN 0.71+ and mandatory from RN 0.80+. If your project is not yet on the New Architecture, you’ll need to enable it before upgrading.Installation
package.json before adding the new one.
Client Initialization
Before
After
StytchClientConfiguration constructor takes optional second and third arguments for endpointOptions and defaultSessionDuration.
Hooks
useStytchUser() and useStytchSession()
The old SDK wrapped these values in a SWR object to indicate whether the value was loaded from cache. The new SDK returns the values directly.
useStytch()
Unchanged in name; the returned client type has changed from StytchClient to StytchConsumer, which has a slightly different method surface (see below).
New: useStytchAuthenticationState()
The new SDK adds a dedicated hook for observing full authentication state. This is the replacement for stytch.onStateChange():
Authentication State Observation
Before
After
TheStytchProvider handles observation internally — in most cases you don’t need to call the observer directly. Just use the hooks. If you do need to observe outside of React (e.g. in a navigation guard), use authenticationStateObserver:
OTP
Before
After
otps→otpmethod_id→methodIdsession_duration_minutes→sessionDurationMinutesauthenticate()now takes a single object, not positional arguments
Email Magic Links
OAuth
The OAuth flow has been simplified. The old SDK returned an intermediate token fromstart() or startWithRedirect() that you then had to pass to oauth.authenticate(). The new SDK does everything — browser, redirect, token exchange — inside a single start() call.
Before
After
oauth.authenticate() call needed. The start() method accepts a flat parameters object with camelCase keys.
Google OneTap / Google Credential Manager
The old SDK exposed a dedicatedstytch.oauth.googleOneTap() method for native Google login. In the new SDK, this is unified into stytch.oauth.google.start() — the SDK automatically uses Google Credential Manager when a GoogleCredentialConfiguration is provided at initialization.
GoogleCredentialConfiguration is provided, or if Google Credential manager fails on the user’s device, oauth.google.start() falls back to browser-based OAuth.
Note: Google Credential Manager is only supported in the consumer SDK. Google Credential Manager is not supported in the B2B SDK.
Biometrics
The old SDK required you to callgetBiometricRegistrationId() to check whether a registration existed, then branch manually. The new SDK replaces this with getAvailability(), which returns a typed enum, with more explicit statuses.