Skip to main content

Requirements

  • A React Native project using the latest version
  • iOS and Android platform support (Web is not supported)

Installation

Core Dependencies

Install the Privy React Native SDK and its peer dependencies:

Required Polyfills

Install the necessary polyfills:
If your app uses the Expo bare workflow (“React Native without Expo”), also run:

Configure Polyfills

Create an entrypoint.js file and update your package.json:
entrypoint.js
package.json
If you’re using the @solana/web3.js package, install the buffer dependency:
And add this code after importing react-native-get-random-values:
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: