New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@thru/browser-sdk

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thru/browser-sdk

Low-level browser SDK for embedding the Thru wallet experience. It manages the iframe-based embedded provider, forwards lifecycle events, and exposes a ready-to-use `Thru` RPC client alongside wallet account management utilities.

latest
npmnpm
Version
0.2.14
Version published
Weekly downloads
757
5307.14%
Maintainers
1
Weekly downloads
 
Created
Source

@thru/browser-sdk

Low-level browser SDK for embedding the Thru wallet experience. It manages the iframe-based embedded provider, forwards lifecycle events, and exposes a ready-to-use Thru RPC client alongside wallet account management utilities.

Installation

npm install @thru/browser-sdk

Basic Usage

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

// Configure the wallet iframe location and the RPC endpoint to talk to
const sdk = new BrowserSDK({
  iframeUrl: 'https://wallet.thru.org/embedded',
  rpcUrl: 'https://grpc-web.alphanet.thruput.org',
});

await sdk.initialize(); // injects the iframe once

// Observe lifecycle events
sdk.on('connect', ({ accounts }) => {
  console.log('Connected accounts', accounts);
});
sdk.on('disconnect', () => console.log('Wallet disconnected'));
sdk.on('error', (err) => console.error('Wallet error', err));

// Trigger the wallet connect flow
const result = await sdk.connect();
const primary = result.accounts[0];

// Use the embedded Thru RPC client
const thru = sdk.getThru();
const account = await thru.accounts.get(primary.address);

// Disconnect when finished
await sdk.disconnect();

Key Capabilities

  • Handles iframe creation and cleanup (initialize, destroy)
  • Connection helpers (connect, disconnect, isConnected, selectAccount)
  • Event emitter for wallet state changes (connect, disconnect, lock, error, accountChanged)
  • Access to a typed Thru RPC client via sdk.getThru() for querying on-chain data or submitting transactions

FAQs

Package last updated on 01 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts