npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@stytch/react-native

v0.72.0

Published

Stytch's official React Native Library

Readme

Stytch React Native SDK

Installation

With npm npm install @stytch/react-native @stytch/react-native-inappbrowser-reborn --save

If your project uses a bare React Native workflow on iOS: cd ios && pod install && cd ..

Dependencies

The Stytch React Native SDK uses React v17+ and React Native v63+.

The Biometrics product depends on iOS 13+ and Android 6+. We only support Class 3 biometric sensors on Android. If you are testing biometrics on an iOS simulator or Android emulator, please ensure you are using one of the following versions: iOS 13 or 14, Android 11 or below. This should not be an issue on physical devices.

Documentation

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

You can find the changelog here.

Example Usage

Check out our example app here.

Testing

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,
) => {
  stytch.magicLinks
    .authenticate(token, { session_duration_minutes: 60 })
    .then((res) => {
      onSuccess(res);
    })
    .catch((e) => {
      onFailure();
    });
};

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(
      'mock_token',
      mockStytchClient,
      (res) => {
        userData = res;
      },
      () => console.log('success'),
    );
    expect(userData.user_id).toBe('abc-123');
  });
});

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 its own function, you can also create mock StytchClients and return them from the useStytch hook like this.

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

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

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

    const component = renderer.create(<MyComponent />);
    expect(mockStytchClient.magicLinks.email.loginOrCreate).toHaveBeenCalledWith('[email protected]');
  });
});

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

Typescript Support

There are built in typescript definitions in the npm package.

Get help and join the community

Stytch community Slack

Join the discussion, ask questions, and suggest new features in our ​Slack community!

Need support?

Check out the Stytch Forum or email us at [email protected].