This package has been deprecated

Author message:

This package is now deprecated. Please use the @stytch/react-native package for all React Native projects. More information here:

TypeScript icon, indicating that this package has built-in type declarations

0.8.7 • Public • Published

Stytch React Native Expo SDK


This package is deprecated and no longer actively maintained. To continue using the Stytch React Native SDK, please follow the migration guide and use the @stytch/react-native package.


With npm npm install @stytch/react-native-expo --save

If you are using the Biometrics product npm install @stytch/react-native-modules --save cd ios && pod install && cd ..

If you are using an "ejected" Expo app npm install @react-native-async-storage/async-storage --save cd ios && pod install && cd..


The Stytch React Native Expo SDK uses React v17+

The Biometrics product depends on iOS 13+ and Android M+

If you are testing the Biometrics product on an iOS emulator, ensure that the emulator is not running iOS 15. There is a bug in iOS 15 that affects testing biometrics on emulators. It should not effect testing on real devices or production apps.


For full documentation please refer to Stytch's React Native SDK documentation.

Example Usage

Check out our example app here.


To test your integration of the Stytch React Native SDK, we recommend creating methods that take the StytchClient as a parameter when using the client to begin/complete authentication, and then stubbing the StytchClient when testing those methods.

For example, the following method uses the StytchClient to authenticate a magic link.

export const authenticate = (
  token: string,
  stytch: StytchClient,
  onSuccess: (res: MagicLinksAuthenticateResponse) => void,
  onFailure: () => void,
) => {
    .authenticate(token, { session_duration_minutes: 60 })
    .then((res) => {
    .catch((e) => {

In order to test that this method passes the response into the onSuccess method, you could write the following test:

import { authenticate } from '../EMLAuthenticateScreen';

const mockStytchClient = {
  magicLinks: {
    authenticate: jest.fn(() => Promise.resolve({ user_id: 'abc-123' })),

describe('authenticate', () => {
  it('returns data on success', async () => {
    let userData;
    await authenticate(
      (res) => {
        userData = res;
      () => console.log('success'),

The above example asserts that your method handles a successful response as expected. You can use this system in order to test any potential successes (with Promise.resolve in the mockStytchClient) or failures (with Promise.reject in the mockStytchClient) that you might expect from Stytch.

If you need to exercise component functionality and cannot abstract the logic into it's own function, you can also create mock StytchClients and return them from the useStytch hook like this.

import { useStytch } from '@stytch/react-native-expo';
import { MyComponent } from './MyComponent';

jest.mock('@stytch/react-native-expo', () => ({
  useStytch: jest.fn(),

describe('MyComponent', () => {
  it('Does something', () => {
    const mockStytchClient = {
      magicLinks: {
        email: {
          loginOrCreate: jest.fn(),

    const component = renderer.create(<MyComponent />);

The above example tests that the MyComponent component calls the StytchClient method with a specific input.

Typescript Support

There are built in typescript definitions in the npm package.




Package Sidebar


DownloadsWeekly Downloads






Unpacked Size

278 kB

Total Files


Last publish


  • danny-stytch
  • allison-stytch
  • ollie-stytch
  • taronish-stytch
  • jonathanyuen-stytch
  • marygruen
  • jennifer-stytch
  • jhaven-stytch
  • nicole-stytch
  • susie-stytch
  • cal-stytch
  • anmol-stytch
  • jeremy-stytch
  • austin-stytch
  • max-stytch
  • julianna-stytch
  • reed-stytch
  • grace-stytch