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 And add this code after importing
@solana/web3.js
package, install the buffer dependency:react-native-get-random-values
:Metro build configuration
Metro build configuration
This guide ensures that your application satisfies the following requirements for integrating:Update your
- uses an expo development build.
- has a custom
metro.config.js
file to customize the Metro bundler settings - enables package exports for the Metro bundler:
- uses the
bundler
setting for Typescript’smoduleResolution
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.
metro.config.js
like so:Typescript’s Module Resolution
Also configure yourtsconfig.json
like so: