B2B Saas Authentication

/

Mobile SDKs

/

React Native SDK reference

/

Installation

Installation

Install the relevant packages as a project dependency via npm or yarn.

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

If you are working in a bare workflow in iOS, you will need to run pod install within the ios directory to install the dependencies.

Initialize the SDK by creating a new StytchB2BClient object provided in the package. We recommend storing the created client instance in a common file to use it in JavaScript methods such as Redux actions.

StytchB2BClient parameters


public_tokenstring

At the root level of your application, initialize a new StytchB2BProvider object using your public token. To provide all components with access to the StytchB2BClient as well as Member and Session data via hooks.

StytchB2BProvider props


stytchStytchB2BClient | null

Example

import { StytchB2BClient, StytchB2BProvider } from '@stytch/react-native/b2b';

const stytch = new StytchB2BClient('PUBLIC_TOKEN');

export const App = () => {
  return (
    <StytchB2BProvider stytch={stytch}>
      <Component />
    </StytchB2BProvider>
  );
};