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.
pnpm add @seams/wallet@0.42.0import { 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
- Set up a wallet and authenticate with passkeys, unlock, or Google Email OTP.
- Sign transactions and messages on NEAR, with NEP-413, or on an EVM-family chain.
- Manage advanced wallet operations with linked devices, recovery, and key export.
- Customize wallet surfaces across React and wallet-iframe UI.
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
- SDK reference for public types and entry points.
- Results and errors for failure branches.
- Events and progress for flow updates.
- Concepts and security when you need the protocol details behind a working integration.