https://github.com/alchemyplatform/aa-sdk-rn-expo
Example repo using aa-sdk with react native and expo
https://github.com/alchemyplatform/aa-sdk-rn-expo
Last synced: about 1 year ago
JSON representation
Example repo using aa-sdk with react native and expo
- Host: GitHub
- URL: https://github.com/alchemyplatform/aa-sdk-rn-expo
- Owner: alchemyplatform
- Created: 2024-05-04T00:00:58.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-13T02:52:07.000Z (over 1 year ago)
- Last Synced: 2025-04-14T03:07:25.281Z (about 1 year ago)
- Language: TypeScript
- Size: 771 KB
- Stars: 2
- Watchers: 6
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Account Kit RN Example using Expo
This is a sample repo that used expo to get started and integrates with Account Kit

## How it was made
1. First create a new expo project (we used `yarn`):
```bash
yarn create expo-app --template
```
This project used a `Blank (typescript)` template.
2. Upgrade to the latest beta version of expo. This is needed because react native 0.74+ includes native support for `TextEncoder`
```bash
yarn expo install expo@next --fix
```
3. Install shims for crypto libraries
```bash
yarn expo install node-libs-react-native crypto-browserify stream-browserify react-native-get-random-values
```
4. Add shims to `metro.config.js`:
```javascript
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require("expo/metro-config");
/** @type {import('expo/metro-config').MetroConfig} */
const config = getDefaultConfig(__dirname);
config.resolver.extraNodeModules = {
...config.resolver.extraNodeModules,
...require("node-libs-react-native"),
crypto: require.resolve("crypto-browserify"),
stream: require.resolve("stream-browserify"),
};
module.exports = config;
```
5. Import global shims in `App.tsx`:
```typescript
import "node-libs-react-native/globals.js";
import "react-native-get-random-values";
// rest of App.tsx
```
6. Install [Account Kit](https://accountkit.alchemy.com) Packages. At this point you're ready to use the aa-sdk in your project.
```bash
yarn add viem@2.8.6 @alchemy/aa-alchemy @alchemy/aa-core @alchemy/aa-accounts
```