Install
Requires React 18 or 19.
1. Create the Aurum instance
Put the instance in its own module so the entire app imports the same singleton.src/lib/aurum.ts
2. Wrap the app in AurumProvider
src/main.tsx
3. Build a connect button
useAccount exposes connection state (and rerenders on accountsChanged automatically). useConnect and useDisconnect trigger the modal flows.
src/components/ConnectButton.tsx
isInitializing is true while Aurum restores any persisted connection from the previous session. Always render a placeholder to avoid a flash of “disconnected” state on reload.4. Sign a message
aurum.rpcProvider is EIP-1193 compatible — wire it into viem or ethers.
src/components/SignMessageButton.tsx
5. Switch chains
src/components/SwitchChainButton.tsx
Chain object so wallets that haven’t added it yet can prompt the user to do so.
Common patterns
Gate content behind a connection
Handle user-rejected and wallet-not-installed errors
Next steps
Customization
Theme the modal
Headless mode
Build a fully custom UI
React Hooks
Hooks API reference