Skip to main content
TanStack Start is a full-stack React framework with classic SSR + hydration (no React Server Components). Aurum’s AurumProvider is 'use client'-marked and SSR-safe — getServerSnapshot returns the initializing state on the server, then the real connection state hydrates on the client. No special boundaries are needed.

Install

Requires React 18 or 19.

1. Create the Aurum instance

src/lib/aurum.ts
The Aurum constructor is SSR-safe — it guards window and localStorage access internally — so this module imports cleanly on both server and client.
new Aurum() is a singleton; calling it again returns the existing instance. Keep this file as the only place you construct it, and import aurum from here everywhere else.

2. Wrap the root route

AurumProvider lives in the root route’s component, around the <Outlet />:
src/routes/__root.tsx

3. Build a connect button

Use the hooks anywhere in your route tree — no extra boundary needed.
src/components/ConnectButton.tsx
isInitializing is true during SSR and during the brief client-side connection-restore. Always render a placeholder so the server-rendered HTML and the first client paint match.
Drop it into a route like any other component:
src/routes/index.tsx

4. Sign a message

src/components/SignMessageButton.tsx
See the Viem, Ethers v5, or Ethers v6 pages for the full surface.

Server-side caveats

  • Route loaders and server functions cannot read wallet state. Loaders run on the server, where there is no wallet connection. Read the wallet client-side and pass any signed/derived data to server functions (e.g. via SIWE).
  • beforeLoad cannot gate routes by connection. Use a client-side guard component or read useAccount() inside the route component instead.
  • Don’t construct multiple Aurum instances per route. Keep one src/lib/aurum.ts import everywhere.

Common patterns

Client-side route guard

src/components/RequireConnection.tsx
Wrap any protected route’s component in <RequireConnection>.

Sign-in with Ethereum (SIWE) for server functions

Server functions can verify a signed message to prove ownership of an address — sign it client-side with viem/ethers, then pass { address, signature, message } to the server function for verification.

Next steps

Customization

Theme the modal

Headless mode

Build a fully custom UI

React Hooks

Hooks API reference