Apps that want full control over the connection flow can connect directly to any wallet, bypassing Aurum’s UI.
Custom UI See headless mode in action
Overview
Headless mode supports three connection methods
Direct Connect One-line connection to injected wallets
Email Auth Three-step OTP flow for embedded wallet
WalletConnect URI Display a custom QR code
Direct Wallet Connection
Connect to installed wallets directly (MetaMask, Phantom, WalletConnect modal, etc) without showing the Aurum modal
import { WalletId } from '@aurum-sdk/types' ;
const address = await aurum . connect ( WalletId . MetaMask );
Show Supported Wallet IDs
WalletId.MetaMask
WalletId.Phantom
WalletId.CoinbaseWallet
WalletId.Rabby
WalletId.Brave
WalletId.WalletConnect
Email and WalletConnect (using custom QR code) have dedicated methods below and cannot be used with connect(walletId).
Email Authentication
A three-step OTP flow for Coinbase Embedded Wallet
Send OTP
Call emailAuthStart(email) with the user’s email address.
Collect OTP
Prompt the user to enter the OTP code from their inbox.
Verify & Connect
Call emailAuthVerify(flowId, otp) to complete the connection.
// Step 1: Send OTP
const { flowId } = await aurum . emailAuthStart ( 'user@example.com' );
// Step 2: User enters OTP from their email
const otp = await promptUserForOTP ();
// Step 3: Verify and connect
const { address , email , isNewUser } = await aurum . emailAuthVerify ( flowId , otp );
Show Method API reference
emailAuthStart(email)
Promise<{ flowId: string }>
Sends an OTP code to the provided email address. Returns a flowId needed for verification.
emailAuthVerify(flowId, otp)
Promise<{ address: string, email: string, isNewUser: boolean }>
Verifies the OTP and completes the wallet connection. Returns the connected address and whether this is a new user.
WalletConnect URI
Display your own QR code for WalletConnect-compatible wallets
Get Session URI
Call getWalletConnectSession() to generate a connection URI.
Display QR Code
Render the URI as a QR code using your preferred library.
Wait for Connection
The waitForConnection() promise resolves when the user scans and approves.
const { uri , waitForConnection } = await aurum . getWalletConnectSession ();
// Display your own QR code
renderQRCode ( uri );
// Wait for user to scan and approve
try {
const address = await waitForConnection ();
} catch ( error ) {
console . error ( error );
}
Show Method API reference
getWalletConnectSession()
Promise<{ uri: string, waitForConnection: () => Promise<`0x${string}`> }>
Initiates a WalletConnect session. Returns the URI for QR code generation and a promise that resolves to the connected address.
Modal Mode Default modal UX
Widget Embed the UI inline