An Expo-managed workflow example that mirrors rn-bare-quick-start but uses expo-web-browser and expo-secure-store instead of the bare equivalents.
- Expo-specific provider setup (
expo-web-browser,expo-secure-store,expo-linking) index.tsentry point that imports@web3auth/react-native-sdk/setupfirst- Logging in with email OTP, reading wallet address/balance, signing a message via
connection.ethereumProvider - Wallet Services helpers (wallet UI, MFA, access token, auth token info, session refresh)
| File | What it does |
|---|---|
web3authConfig.ts |
The only file you edit — Client ID, redirect URL (via expo-linking), network |
lib/evm.ts |
Pure EVM helpers (getAddress, getBalance, signMessage) — no React |
App.tsx |
<Web3AuthProvider> (Expo variant) + HomeScreen with inlined login/logged-in views |
index.ts |
Entry point — @web3auth/react-native-sdk/setup first, then registerRootComponent(App) |
babel.config.js |
hermes-v0 transform profile for Web3Auth transitive deps on Hermes |
metro.config.js |
withWeb3Auth() on expo/metro-config plus Expo-specific resolver fixes |
- Expo SDK
~51(React Native0.74.x— upgrade to Expo SDK 56+ / React Native 0.84+ when available to drop URL polyfills; see RN 0.84 URL improvements) @web3auth/react-native-sdk^10.0.0expo-web-browser+expo-secure-store@react-native-async-storage/async-storagereact-native-quick-crypto+react-native-quick-base64viem^2.x
- Node.js
>=18 - Expo CLI:
npm install -g expo-cli - Expo Go or a development build
- A Web3Auth Dashboard project
- Create a project at dashboard.web3auth.io.
- Under Allowed Origins, add the redirect URL your build resolves to:
- Dev client / standalone:
web3authexpoexample://web3auth - Expo Go: output of
Linking.createURL("web3auth", {})(seeweb3authConfig.ts)
- Dev client / standalone:
- Copy the Client ID into
web3authConfig.ts.
cd rn-expo-example
npm installnpm start # Expo DevTools
npm run ios # iOS simulator (requires Xcode)
npm run android # Android emulator (requires Android Studio)| Bare | Expo | |
|---|---|---|
| Web browser | @toruslabs/react-native-web-browser |
expo-web-browser |
| Secure storage | react-native-encrypted-storage |
expo-secure-store |
| Redirect URL | scheme in Info.plist / AndroidManifest.xml |
Linking.createURL() in web3authConfig.ts |
| Entry point | index.js with AppRegistry |
index.ts with registerRootComponent |
import * as WebBrowser from "expo-web-browser";
import * as SecureStore from "expo-secure-store";
<Web3AuthProvider webBrowser={WebBrowser} storage={SecureStore} config={getWeb3AuthConfig(useAA)}>index.ts imports @web3auth/react-native-sdk/setup as the very first line. metro.config.js uses withWeb3Auth() on top of expo/metro-config. babel.config.js sets unstable_transformProfile: "hermes-v0" for Hermes.
Bare workflow examples in this repo target React Native 0.84+, where URL / URLSearchParams are built in. This Expo example still runs on SDK 51 (RN 0.74) until Expo SDK 56 is released.
react-native-quick-base64 is a direct dependency so Expo autolinks the native module used by react-native-quick-crypto.
OAuth redirect not working — Confirm web3authexpoexample://web3auth is allowlisted in the dashboard and matches app.json / Info.plist.
Metro / Hermes errors after upgrading deps — Clear the Metro cache (npx expo start --clear) and rebuild the native app. See Metro Polyfill Troubleshooting.
MIT — see LICENSE.