Demonstrates Grouped Connections (formerly "aggregate verifiers"): multiple login methods that all resolve to the same wallet address for the same user.
Without grouping, Google login and Email OTP login produce completely different wallets. Grouped Connections fix that by linking sub-connections under one shared key namespace.
- Three login buttons (Google, Email OTP via Auth0, GitHub via Auth0) sharing
groupedAuthConnectionId: "aggregate-sapphire" - Each method logs the same user into the same Ethereum wallet
- Full split structure:
LoginView,HomeView,Console,lib/evm.ts - The
authConnectionId+groupedAuthConnectionIdpattern (replacesloginConfig.verifierSubIdentifier)
| File | What it does |
|---|---|
web3authConfig.ts |
The only file you edit — Client ID, redirect URL, network, chain config |
lib/evm.ts |
Pure EVM helpers (getAddress, getBalance, signMessage) — no React |
components/LoginView.tsx |
Three login buttons — each passes authConnectionId + groupedAuthConnectionId |
components/HomeView.tsx |
All post-login actions — blockchain calls, wallet UI, MFA, disconnect |
components/Console.tsx |
Dumb scrollable output box — <Console output={...} /> |
App.tsx |
<Web3AuthProvider> + Screen that switches between Login/Home |
index.js |
Entry point — @web3auth/react-native-sdk/setup must be the very first import |
metro.config.js |
withWeb3Auth() sets up all polyfill aliases |
- React Native
0.74.x(bare workflow) @web3auth/react-native-sdk^10.0.0viem^2.x@react-native-async-storage/async-storage^1.23.x(peer for@metamask/connect-multichainvia@web3auth/react-native-sdk)
- Node.js
>=18, React Native CLI environment, Xcode / Android Studio - A Web3Auth Dashboard project with a Grouped Connection configured
- Create a project at dashboard.web3auth.io.
- Under Connections, create three individual connections:
w3a-google— Google social loginw3a-a0-email-passwordless— Auth0 email OTP (verifier ID field:email)w3a-a0-github— Auth0 GitHub (verifier ID field:email)
- Create a Grouped Connection named
aggregate-sapphireand add all three as sub-connections. The shared verifier ID field (email) is what links the Google and Auth0 identities. - Under Allowed Origins, add:
web3authrnbareaggregateexample://auth - Copy the Client ID into
web3authConfig.ts.
Why
alice@gmail.comvia Google ==alice@gmail.comvia Auth0 Email OTP → same wallet.
cd rn-bare-aggregate-verifier-example
npm install
# iOS
cd ios && pod install && cd ..npm start
npm run ios # or npm run android// All three calls share the same groupedAuthConnectionId.
// The SDK routes each through its own sub-connection but combines
// them into one key derivation path.
connectTo({
authConnection: AUTH_CONNECTION.GOOGLE,
authConnectionId: "w3a-google",
groupedAuthConnectionId: "aggregate-sapphire", // ← the grouping key
});The wallet address returned by getAddress(connection!.ethereumProvider) is identical no matter which of the three buttons was used, as long as the user's email is the same across providers.
Different addresses for the same user — Check that the groupedAuthConnectionId is identical across all connectTo calls, that the Grouped Connection on the Dashboard includes all sub-connections, and that the verifier ID field resolves to the same value across providers.
Metro errors — See Metro Polyfill Troubleshooting.
@react-native-async-storage/async-storage not found — Install it explicitly: npm install @react-native-async-storage/async-storage@^1.23.1. Required by @metamask/connect-multichain (pulled in via @web3auth/react-native-sdk). After installing, run cd ios && pod install for iOS.
MIT — see LICENSE.