Skip to main content

Installation

pnpm add @aurum-sdk/core

Configuration Options

The Aurum instance accepts three configuration parameters - brand, wallets, and telemetry.
Customize the look and feel of the modal.
appName
string
Your application’s display name
URL to your logo image (https://... or data:image/...)
theme
'light' | 'dark'
Color scheme for the modal
primaryColor
string
Hex color for buttons and accents
borderRadius
'none' | 'sm' | 'md' | 'lg' | 'xl'
Corner rounding for UI elements
font
string
Custom font family
Hides “powered by Aurum” footer
modalZIndex
number
z-index for modal
walletLayout
'stacked' | 'grid'
Wallet button arrangement
Configure wallet providers and availability.
embedded.projectId
string
Project ID for email wallet functionality
walletConnect.projectId
string
Project ID for WalletConnect
exclude
WalletId[]
Wallet IDs to hide from the connection UI (['email', 'metamask', etc])
telemetry
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

const aurum = new Aurum({
  brand: { 
    appName: 'Aurum Demo',
    theme: 'dark',
  },
  wallets: {
    embedded: { projectId: 'cdp-project-id' },
    walletConnect: { projectId: 'reown-project-id' },
  },
});

Aurum Properties

rpcProvider

Returns AurumRpcProvider EIP-1193 compatible provider. Works with viem, ethers.js, and other web3 libraries.
const accounts = await aurum.rpcProvider.request({ method: 'eth_accounts' });
See full integration guides for Viem, Ethers v5 and Ethers v6.

Aurum Methods

whenReady()

Returns Promise<void> Waits for the SDK to finish initializing, such as restoring any previous connection after a page refresh.
await aurum.whenReady();

// Safe to use the provider
const balance = await aurum.rpcProvider.request({
  method: 'eth_getBalance',
  params: [address, 'latest'],
});
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.
// Show modal
const address = await aurum.connect();

// Connect directly to a specific wallet
import { WalletId } from '@aurum-sdk/types';

const address = await aurum.connect(WalletId.MetaMask);
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.
await aurum.disconnect();

isConnected()

Returns Promise<boolean> Returns whether a wallet is currently connected.
const connected = await aurum.isConnected();

getUserInfo()

Returns Promise<UserInfo | undefined> Returns info about the connected user, or undefined if not connected.
const user = await aurum.getUserInfo();
if (user) {
  console.log(`Connected: ${user.walletName}`);
}

getChainId()

Returns Promise<number> Returns the current chain ID.
const chainId = await aurum.getChainId();

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.
import { polygon } from 'viem/chains';

await aurum.switchChain(polygon.id, polygon);
Throws an error if the user rejects the request

updateBrandConfig(newConfig)

**Returns **void Updates the brand configuration at runtime (theme, font, walletLayout, etc).
aurum.updateBrandConfig({ theme: 'light' });

updateWalletsConfig(newConfig)

Returns void Updates the wallets configuration at runtime. Currently only supports exclude.
import { WalletId } from '@aurum-sdk/types';

aurum.updateWalletsConfig({ exclude: [WalletId.Phantom] });