Skip to content

Examples

Start with a working Seams wallet, then add signing, recovery, device linking, exports, and theming.

Examples ​

You can copy these examples into an application. For a Seams wallet, configure the provider first, then register or unlock a wallet. Choose the operation your product needs.

For external NEAR wallets, use the compiled connector example. It is a development preview with separate imports and no Seams provider requirement. The prerequisites below apply to Seams wallet examples.

Prerequisites ​

Install the SDK and configure the wallet origin, relayer, and registration environment variables used by your app.

sh
pnpm add @seams/wallet@0.42.0
tsx
import { SeamsWebProvider, seamsTestnetConfig, useSeams } from '@seams/wallet/react';

// Everything else — wallet service path, SDK base path, relayer account, chain
// RPC and explorer URLs — comes from the SDK defaults.
const seamsConfig = seamsTestnetConfig({
  walletOrigin: import.meta.env.VITE_WALLET_ORIGIN,
  relayerUrl: import.meta.env.VITE_RELAYER_URL,
  publishableKey: import.meta.env.VITE_SEAMS_PUBLISHABLE_KEY,
});

function WalletApp() {
  const { loginState } = useSeams();
  return <p>{loginState.isLoggedIn ? 'Wallet unlocked' : 'Wallet locked'}</p>;
}

export function App() {
  return (
    <SeamsWebProvider config={seamsConfig}>
      <WalletApp />
    </SeamsWebProvider>
  );
}

The Seams wallet examples below target release 0.42.0 and iframe protocol 23.0.0. The setup configures NEAR and Tempo testnets. The Ethereum Sepolia example requires adding that chain as shown in the signing guide.

The setup example keeps the provider at the application boundary. Render your wallet UI inside SeamsWebProvider. Pass the seams instance and wallet identity into the operation examples.

Choose an example ​

How to use the snippets ​

The <<< blocks import the canonical TypeScript examples from this directory. Copy the function or component you need, then connect it to your own UI and error reporting. Values such as walletId, nearAccountId, and Google ID tokens come from your authenticated application state.

Every flow returns a typed success or failure result, or reports progress with an event callback. Keep the branch handling in the examples when adapting them so cancellation, policy denial, and expired sessions remain recoverable.

Continue building ​