Skip to main content

Requirements

  • A React Native project using the latest version
  • iOS and Android platform support (Web is not supported)
  • A development build with the New Architecture enabled. The SDK depends on native modules, so it does not run in Expo Go.

Installation

Core Dependencies

Install the Privy React Native SDK and its peer dependencies:
For fine-grained control over your project’s dependencies, React Native 0.81+ (or Expo SDK 54+) allows you to omit the following optional packages if you are not utilizing their corresponding features:
  • expo-apple-authentication for native Sign in with Apple
  • react-native-passkeys for passkey authentication
  • @privy-io/expo-native-extensions for iCloud recovery
Only omit these packages if you are certain your application will never invoke these specific authentication methods. Calling these features without the underlying dependencies installed will result in runtime crashes.
If your app uses the Expo bare workflow (“React Native without Expo”), also run:

Configure polyfills

Privy’s polyfills install WebCrypto (crypto.getRandomValues, crypto.randomUUID, and crypto.subtle) from react-native-quick-crypto. Import them before any other module, so that every library sees them when it loads.
Create an entrypoint.js file and update your package.json:
entrypoint.js
package.json
The polyfills only fill in what is missing. An existing WebCrypto setup, such as your app’s own react-native-quick-crypto install(), is kept, and the polyfills never set Buffer.

Upgrading from earlier versions

Earlier versions of the SDK required expo-crypto, fast-text-encoding, react-native-get-random-values, and @ethersproject/shims. To upgrade, install react-native-quick-crypto, react-native-nitro-modules, and react-native-quick-base64, then rebuild your app. The existing polyfill setup keeps working. Replace those polyfill imports with import '@privy-io/expo/polyfills' to get the full crypto API, and remove the packages if nothing else in your app uses them.
react-native-quick-crypto is a native module. Ship this upgrade in a new app binary, not as an over-the-air update to a binary built without it.

Testing with Jest

react-native-quick-crypto (1.1.8 or later) ships a mock for Jest. Add it to your Jest setup file:
This guide ensures that your application satisfies the following requirements for integrating:

Enabling Package Exports

React Native 0.79, and Expo 53, have enabled package exports by default.Some popular packages present incompatibilities with this change, and the community is working to get these fixed at source. In the meantime, we present a fix below by disabling package exports for the incompatibilities we have found.
Update your metro.config.js like so:

Typescript’s Module Resolution

Also configure your tsconfig.json like so: