/
Contact usSee pricingStart building
    Overview
    iOS SDK reference
    Android SDK reference

    React Native SDK reference

    Installation
    Changelog
    Organizations
      Get Organization
      Get Organization by Slug
      Update Organization
      Delete Organization
    Members
      Get Member
      Create Member
      Update Member
      Search Members
      Delete Member
      Reactivate Member
      Delete Member Password
      Delete Member MFA Phone Number
      Delete Member MFA TOTP
      Unlink Retired Member Email
      Update Self
      Delete Self Password
      Delete Self MFA Phone Number
      Delete Self MFA TOTP
      Unlink Retired Self Email
      Update Member (Deprecated)
      Delete Member MFA Phone Number (Deprecated)
    RBAC
      Is Authorized
      Permissions
    Email Magic Links
      Login or Signup
      Invite
      Authenticate
      Send Discovery Email
      Authenticate Discovery Magic Link
    Session Management
      Get Session
      Authenticate Session
      Revoke Session
      Exchange Session
      Get Tokens
      Revoke Sessions for Member
    SSO
      Start SSO Flow
      Authenticate
      Get SSO Connections
      Delete SSO Connection
      Create SAML Connection
      Update SAML Connection
      Update SAML Connection by Metadata URL
      Delete Verification Certificate
      Create OIDC Connection
      Update OIDC Connection
      Create External Connection
      Update External Connection
    Discovery
      List Discovered Organizations
      Create Organization via Discovery
      Exchange Intermediate Session
    Passwords
      Authenticate
      Reset by Email Start
      Reset by Email
      Reset by Existing Password
      Reset by Session
      Strength Check
    SCIM
      Create SCIM Connection
      Update SCIM Connection
      Delete SCIM Connection
      Get SCIM Connection
      Rotate SCIM Token Start
      Rotate SCIM Token Complete
      Rotate SCIM Token Cancel
    Multi-factor Authentication
    • One-Time Passcodes

      • SMS Send
        SMS Authenticate
    • Time-Based One-Time Passcodes

      • TOTP Create
        TOTP Authenticate
    • Recovery Codes

      • Recovery Codes Recover
        Rotate Recovery Codes
        Get Recovery Codes
    Pre-built UI
      UI Configuration
    More Resources
      SWR & caching
      Deep linking
      Android KeyStore considerations
Get support on SlackVisit our developer forum

Contact us

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 using a static framework, you will want to use the following static version of our React Native SDK instead.
npm install @stytch/react-native-static @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_token string

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


stytch StytchB2BClient | 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>
  );
};