Getting started with Account Kit on bare React Native
This guide assumes you already have a Bare React Native app and want to integrate Account Kit. If you are starting a project from scratch, we recommend following the Expo guide instead.
We would go through the steps to get your environment setup for using Account Kit within a Bare React Native application.
Set up shims
Once we’ve got our React Native project setup and running, we need to setup a few shims so we can use crypto libraries in React Native.
Install shim dependencies
Register shim modules in Metro
Create or edit your metro.config.js
file in the root of your project so that it includes the following:
Register global shims
Import the following packages at the top of your index.js
file so that libraries that depend on globals like crypto
have access to them.
Install Account Kit and build!
That’s it! Now you can install the packages you want from Account Kit and start building your React Native Account Abstraction app.
The @account-kit/react-native
package is an ESM module. As such, you might have to add the following to your tsconfig.json
’s compilerOptions
:
Add supporting dependencies
To ensure the Signer package works correctly, you’ll need to add the following dependencies to your project:
Build and run your project
Now that we’ve got everything setup, we can build our project!