Skip to main content

@kea-wallet/browser-sdk

Browser SDK for KEA Wallet — wraps the embedded provider with ThruClient RPC and automatic dApp metadata resolution.

Installation​

npm install @kea-wallet/browser-sdk

Quick Start​

import { BrowserSDK } from '@kea-wallet/browser-sdk';

const sdk = new BrowserSDK();
const { accounts } = await sdk.connect();
console.log('Connected:', accounts[0].address);

Key Concepts​

  • Automatic initialization — BrowserSDK.connect creates the wallet iframe on demand; call BrowserSDK.initialize explicitly only to pre-load.
  • Event-driven — subscribe to 'connect', 'disconnect', 'accountChanged', 'lock', and 'error' events via BrowserSDK.on.
  • gRPC-web RPC — access the Thru blockchain directly via BrowserSDK.getThru without requiring a connected wallet.
  • Metadata auto-resolution — appName and appUrl are derived from window.location unless explicitly set in ConnectOptions.metadata.

See​

Lifecycle​

ClassDescription
BrowserSDKHigh-level browser SDK for KEA Wallet integration.

Other​

ErrorCode​

Renames and re-exports ConnectResult


IThruChain​

Renames and re-exports ConnectResult


WalletAccount​

Renames and re-exports ConnectResult