Skip to main content

Installation

Configuration Options

The Aurum instance accepts three configuration parameters - brand, wallets, and telemetry.
Customize the look and feel of the modal.
string
Your application’s display name
URL to your logo image (https://... or data:image/...)
'light' | 'dark'
Color scheme for the modal
string
Hex color for buttons and accents
'none' | 'sm' | 'md' | 'lg' | 'xl'
Corner rounding for UI elements
string
Custom font family
Hides “powered by Aurum” footer
number
z-index for modal
'stacked' | 'grid'
Wallet button arrangement
Configure wallet providers and availability.
string
Project ID for email wallet functionality
string
Project ID for WalletConnect
WalletId[] | string[]
Wallet IDs to hide from the connection UI. Accepts the WalletId enum (recommended for IDE autocomplete and refactor safety) or the equivalent string literals — e.g. [WalletId.Email, WalletId.Phantom] or ['email', 'phantom'].
boolean
default:"true"
Allows Aurum to log unexpected SDK errors using Sentry.io. No PII is ever collected — including email address, IP address, user location, or other identifiable information. Also applies to analytics and error tracking for Email login, Coinbase Wallet, and WalletConnect (Reown).
Embedded: Get your project ID at Coinbase CDPWalletConnect: Get your project ID at Reown Dashboard

Example

Aurum Properties

rpcProvider

Returns AurumRpcProvider EIP-1193 compatible provider. Works with viem, ethers.js, and other web3 libraries.
See full integration guides for Viem, Ethers v5 and Ethers v6.

ready

Returns boolean true once the SDK has finished initializing and restored any persisted connection. Synchronous companion to whenReady() — useful for conditional render in components.

Aurum Methods

whenReady()

Returns Promise<void> Waits for the SDK to finish initializing, such as restoring any previous connection after a page refresh.
await whenReady() before making calls to the rpcProvider to ensure persisted connections are restored and request is routed to the correct provider.

connect(walletId?: WalletId)

Returns Promise<`0x${string}`> Opens the wallet connection modal. Optionally, pass a walletId to connect directly without showing the modal.
For WalletId.Email and custom WalletConnect QR Code flows, see the Headless API. connect('email') will throw an error. connect('walletconnect') will open the WalletConnect modal.
Throws an error if the user closes the modal without connecting.

disconnect()

Returns Promise<void> Disconnects the currently connected wallet.

isConnected()

Returns Promise<boolean> Returns whether a wallet is currently connected.

getUserInfo()

Returns Promise<UserInfo | undefined> Returns info about the connected user, or undefined if not connected.

getChainId()

Returns Promise<number> Returns the current chain ID.

switchChain(chainId, chain?)

Returns Promise<void> Switches to a different network. If the chain isn’t added to the wallet, it will prompt the user to accept the new network and switch to it.
Throws an error if the user rejects the request

updateBrandConfig(newConfig)

**Returns **void Updates the brand configuration at runtime (theme, font, walletLayout, etc).

updateWalletsConfig(newConfig)

Returns void Updates the wallets configuration at runtime. Currently only supports exclude.

Event Listeners

Subscribe to EIP-1193 events directly on the Aurum instance. Listeners registered here survive provider swaps when users connect, disconnect, or switch wallets — register once and they keep firing.

on(event, listener)

Returns void Registers an EIP-1193 event listener. Supported events: accountsChanged, chainChanged, connect, disconnect.

off(event, listener) / removeListener(event, listener)

Returns void Removes a previously registered listener. The two methods are aliases — use whichever fits your style.
Prefer aurum.on() over aurum.rpcProvider.on(). The provider proxy is replaced on connect/disconnect, so listeners attached to it will silently stop firing after the user reconnects.

Errors

All public methods on Aurum throw typed errors that extend AurumError. Discriminate failures via instanceof or the stable code field instead of parsing message strings.

normalizeError(err, context?)

Returns AurumError Wraps an unknown thrown value into the typed hierarchy. Useful if you’re catching errors from a wrapper layer where the original wallet error has already been re-thrown as a generic Error.