Getting started with Account Kit on Expo
We would go through the steps to get your environment setup for using Account Kit within a React Native application on Expo.
Pre-requisites
- React Native version 0.76 or later
- iOS Minumum Deployment Target: 17.0
- Hermes and Fabric must be enabled (if using expo these are on by default)
- The Signer package requires you to be on React Native’s new architecture. For information on how to enable it in your Expo project, check their documentation.
- The Signer package is incompatible with Expo Go and as a result, you’d need to use a Development Build. Check the Expo Development Builds documentation for more information.
Create a new Expo project
If you don’t have an Expo project setup, you can create one using the following command:
Upgrade to the latest version of Expo
The first thing we need to do is make sure we’re on the latest version of Expo (SDK 52 or later). The reason for this is that we need React Native version 0.76 or higher because it has TextEncoder
natively supported.
For more information on upgrading an Expo project, check out the Expo documentation.
You can also use our quickstart template to get started quickly. Simply run
Then you want to upgrade all dependencies to match the new Expo SDK version.
Set up shims
Once we’ve got our Expo 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 topmost entry point of your app so that libraries that depend on globals like crypto
have access to them.
If you are using expo-router
, add the imports in your topmost _layout.tsx
file in the app
directory. However if you are using a different navigation library (e.g. react-navigation
),
add the imports in your topmost App.tsx
file.
Install Account Kit
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:
Set iOS minimum deployment target
Since we require a minimum deployment target of iOS 17, you will need to instruct Expo to set this during pre-build. First, install expo-build-properties
via:
Then add the plugin to your app.json
:
Run a Prebuild!
Now that we’ve got everything setup, we can run a prebuild to ensure the native modules are properly built and added to your project.
Next steps
Now setup the signer!