Skip to main content

Quickstart

Connect your dApp to KEA Wallet and display a user's Thru address in under 5 minutes.

tip

No browser extension required — KEA Wallet runs entirely in a secure iframe and authenticates users with Passkeys (WebAuthn).

Prerequisites
  • Node.js 18+
  • React 18+ (for the React path)
  • A package manager (npm / yarn / pnpm)
Secure Context Required

KEA Wallet uses WebAuthn Passkeys, which require a Secure Context — your app must be served over localhost or HTTPS. Plain http:// will not work.

Step 1: Install

npm install @kea-wallet/react-ui
tip

@kea-wallet/react-ui re-exports everything from @kea-wallet/react-sdk — one install gives you components, hooks, and the provider.

Step 2: Connect the Wallet

import { KeaProvider } from '@kea-wallet/react-sdk';
import { KeaConnectButton } from '@kea-wallet/react-ui';
import { useWallet } from '@kea-wallet/react-sdk';

const config = {
rpcUrl: 'https://grpc-web.alphanet.thruput.org',
autoConnect: true,
};

function App() {
return (
<KeaProvider config={config}>
<Dashboard />
</KeaProvider>
);
}

function Dashboard() {
const { isConnected, selectedAccount } = useWallet();

return (
<div>
<KeaConnectButton />
{isConnected && <p>Address: {selectedAccount?.address}</p>}
</div>
);
}

export default App;
  • KeaProvider initializes the SDK and provides wallet state to all child components.
  • KeaConnectButton handles connect/disconnect and displays the connection state automatically.
  • useWallet() gives you access to accounts, connection flags, and wallet methods.

Step 3: Run and Verify

Start your dev server and test the integration:

  1. Click "Connect Wallet" — a secure modal opens over your app
  2. Authenticate with your Passkey (TouchID / FaceID / security key)
  3. The modal closes — your app displays the connected Thru address
  4. Refresh the page — the session restores automatically (no modal shown)
tip

autoConnect: true stores a session hint in localStorage. On reload, the SDK silently restores the session without showing the modal. See Session Persistence for details.

What's Next