Prerequisites
- A React Native (Expo) project set up for Android development. See the Environment Setup guide.
- An MWA-compatible wallet installed on your device or emulator. See Install a development wallet.
Choose a Solana library
Wallet UI ships one package per Solana client library. Pick one and stay on the matching tab through the rest of this guide.@wallet-ui/react-native-kit— use this for new apps. Built on@solana/kit.@wallet-ui/react-native-web3js— use this when your app already depends on@solana/web3.jsv1.
MobileWalletProvider and useMobileWallet API. Only the Solana primitives they hand you differ.
Install dependencies
- @solana/kit
- @solana/web3.js
@solana-program/memo is only needed for the transaction example in the Quickstart. Swap it for whichever @solana-program/* client your app actually builds instructions with.Configure polyfills
Solana client libraries expect Node and browser APIs that React Native does not ship. Thereact-native-quick-crypto library provides the crypto polyfill they need, and it is the same for both libraries.
1. Create a polyfill.js file in your project root:
polyfill.js
index.js entry point that imports the polyfill first:
index.js
package.json to use the new entry point:
package.json
Custom Development Build
MWA uses Kotlin native modules, so you must use a custom Expo development build instead of Expo Go. Update yourpackage.json build scripts:
Next steps
Setup
Wrap your app with MobileWalletProvider and set up the useMobileWallet hook.
