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

    React Native SDK reference

    Installation
    Changelog
    Configuration
    Pre-built UI
      UI Configuration
    Users
      Get user
      Update user
      Delete authentication factors
    Email Magic Links
      Send
      Login or create
      Authenticate
    OAuth
      Start
      Authenticate
    Passwords
      Create
      Authenticate
      Reset by Email Start
      Reset by Email
      Strength Check
    One-time Passcodes (OTP)
      Login or create via SMS
      Send via SMS
      Login or create via Email
      Send via Email
      Login or create via WhatsApp
      Send via WhatsApp
      Authenticate
    Time-Based One-Time Passcodes (TOTP)
      Create
      Authenticate
      Get Recovery Codes
      Recover
    Session Management
      Get Session
      Authenticate Session
      Revoke Session
      Update Session
      Get Tokens
    Passkeys & WebAuthn
      Register
      Authenticate
      Update
    Biometrics
      Introduction
      Register
      Authenticate
      Keystore available
      Registration available
      Remove registration
      Get sensor
      Errors
    Device Fingerprinting
      Get telemetry ID
    More Resources
      SWR & caching
      Deep linking
      Android KeyStore considerations
Get support on SlackVisit our developer forum

Contact us

Consumer 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.

If you are working with Expo, make sure you're running a Development build. Learn more in our migration guides.

Initialize the SDK by creating a new StytchClient 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.

StytchClient parameters


public_token string

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

StytchProvider props


stytch StytchClient | null
Example
import { StytchClient, StytchProvider } from '@stytch/react-native';

const stytch = new StytchClient('PUBLIC_TOKEN');

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