npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bridgebase/tigerbeetle

v0.2.1

Published

BridgeBase TigerBeetle Adapter - Native TigerBeetle client wrapper with BridgeBase gateway integration

Readme

@bridgebase/tigerbeetle

TigerBeetle adapter for BridgeBase - Native TigerBeetle client with gateway integration.

Features

  • Minimal Abstraction - Direct pass-through to native TigerBeetle client
  • Gateway Integration - Automatic proxy tunnel setup via BridgeBase
  • Full TigerBeetle Support - Access to all TigerBeetle operations
  • Type Safe - Full TypeScript support with native types

Installation

npm install @bridgebase/tigerbeetle

Quick Start

import { connectTigerBeetle, id, type Account } from "@bridgebase/tigerbeetle";

// Auto-connects and returns session
const session = await connectTigerBeetle("your-jwt-token", { clusterId: 0 });
const tb = session.client; // Access native TigerBeetle client

// Use native TigerBeetle client
const account: Account = {
  id: id(),
  debits_pending: 0n,
  debits_posted: 0n,
  credits_pending: 0n,
  credits_posted: 0n,
  user_data_128: 0n,
  user_data_64: 0n,
  user_data_32: 0,
  reserved: 0,
  ledger: 1,
  code: 1,
  flags: 0,
  timestamp: 0n,
};

await tb.createAccounts([account]);

Factory Functions

connectTigerBeetle()

Creates a session and automatically connects:

const session = await connectTigerBeetle(jwtToken, {
  clusterId?: number;     // TigerBeetle cluster ID (default: 0)
  apiBaseUrl?: string;    // BridgeBase API endpoint
});

const tb = session.client; // Native TigerBeetle client

createTigerBeetleSession()

Creates a session without auto-connecting:

const session = createTigerBeetleSession(jwtToken, options);
const tb = await session.connect(); // Manual connect

Accessing TigerBeetle Functions

import { connectTigerBeetle, id } from "@bridgebase/tigerbeetle";

const session = await connectTigerBeetle(token);
const tb = session.client;

// ID generation - standalone function
const accountId = id();

// All native TigerBeetle operations
await tb.createAccounts([...]);
await tb.lookupAccounts([...]);
await tb.getAccountTransfers([...]);

Using Native TigerBeetle Client

Once connected, you have full access to the native TigerBeetle API:

import { connectTigerBeetle, id, type Account } from "@bridgebase/tigerbeetle";

const session = await connectTigerBeetle(token);
const tb = session.client;

// Create accounts
const accounts: Account[] = [
  {
    id: id(),
    ledger: 1,
    code: 1,
    // ... other required fields
  },
];
const errors = await tb.createAccounts(accounts);

// Query accounts
const found = await tb.lookupAccounts([id1, id2]);

// Create transfers
const transfer = {
  id: id(),
  debit_account_id: account1Id,
  credit_account_id: account2Id,
  amount: 100n,
  // ... other required fields
};
await tb.createTransfers([transfer]);

Error Handling

import { ConnectionError, GatewayResolutionError, createTigerBeetleSession } from "@bridgebase/tigerbeetle";

try {
  const session = await connectTigerBeetle(token);
  const tb = session.client;
  await tb.createAccounts([...]);
} catch (error) {
  if (error instanceof GatewayResolutionError) {
    console.error("Failed to resolve gateway");
  } else if (error instanceof ConnectionError) {
    console.error("Failed to connect to TigerBeetle");
  }
} finally {
  await session?.disconnect();
}

Cleanup

const session = await connectTigerBeetle(token);
try {
  const tb = session.client;
  // Use the client
} finally {
  await session.disconnect();
}

License

MIT