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

@tonbo/sdk

v1.1.0

Published

The Tonbo SDK: your Tonbo key, Streams tokens and databases opened by name.

Readme

@tonbo/sdk

The Tonbo SDK for Node.js: your Tonbo key, Streams tokens, and Tonbo databases opened by name.

npm install @tonbo/sdk @tonbo/[email protected]

@tonbo/sqlite-ursula (0.11.3 or later in 0.11) is an optional peer, needed only by @tonbo/sdk/database. Node.js 22.19 or later.

Open a database by name

import { openDatabase } from "@tonbo/sdk/database";

const db = await openDatabase("notes"); // a node:sqlite DatabaseSync
db.exec("CREATE TABLE IF NOT EXISTS notes (body TEXT)");
db.prepare("INSERT INTO notes VALUES (?)").run("hello");
await db.synced(); // the commit is in the stream
db.close();

openDatabase looks the name up in the Management API, waits while the database is being created, and opens it with @tonbo/sqlite-ursula, handing that package a token provider that exchanges your key for short-lived Streams tokens. Your key never reaches the data plane. The signal or timeoutMs (30 s by default) bounds the lookup and the open together. resolveDatabase(name) answers { url, token } for any other opener.

A process sends one token at a time, so every database open on a thread at once uses one credential; an open with another one fails second_credential.

The client

import { Tonbo } from "@tonbo/sdk";

const tonbo = new Tonbo(); // apiKey, else TONBO_API_KEY, else your `tonbo login`
const acme = new Tonbo({ account: "acme" }); // your login, acting in the acme organization

const { token, expiresAt } = await tonbo.tokens.streams();
const forBrowser = await tonbo.tokens.downScope({
  databases: ["notes"],
  readOnly: true,
  expiresIn: 300,
});

const created = await tonbo.databases.create("notes");
const all = await tonbo.databases.list();
await tonbo.databases.delete("notes");
  • The credential is the apiKey option, else TONBO_API_KEY, else your tonbo login on this computer (from @tonbo/cli 0.12, ~/.config/tonbo/login.json), else the file an older tonbo login wrote. A login file is never read when it is a symlink or readable by group or others, and a login made on another computer is refused.
  • The account. An API key reaches only its own account. Your tonbo login reaches every account you belong to, one at a time: the account option (a name or id), else TONBO_ACCOUNT, else the default tonbo account use set, else your personal account. Beside an API key, account and TONBO_ACCOUNT must name the key's own account. Agents and CI should use an Agent key or an API key of one account, not your login.
  • Origins. apiOrigin, else TONBO_API_ORIGIN, else https://api.tonbo.dev; the token endpoint's origin is authOrigin, else TONBO_AUTH_ORIGIN, else the API origin without its api. label. Each is https, or http to a loopback host.
  • Network. The SDK's own requests use Node's fetch, so its trust store and proxy settings apply to them, not URSULA_VFS_CA_FILE.

Errors

Every failure is a TonboError with a kind, an action (retry, stop or fix), a fix where one is known, the status and the requestId. A refused key reaches a database open as the cause of @tonbo/sqlite-ursula's unauthorized error. No message carries a key or a token.

The rules this package follows are contracts/sdk/v1.json in the Tonbo repository.