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

@clidey/whodb-sdk

v0.138.0

Published

Official WhoDB platform SDK — ontology, datasets, and sources as in-code function APIs

Readme

@clidey/whodb-sdk

Official TypeScript/JavaScript SDK for the WhoDB hosted platform — your ontology, datasets, sources, transforms, functions, and org administration as in-code function APIs.

Install

npm install @clidey/whodb-sdk

Requires Node.js ≥ 20.

Quickstart

import { WhoDB } from '@clidey/whodb-sdk';

// Production: API key (create one in org settings → API keys).
// The key carries its org; the project auto-resolves when the key
// has access to exactly one project.
const whodb = new WhoDB({ apiKey: process.env.WHODB_API_KEY });

// Local development: zero config — reuses your `whodb login` session.
// const whodb = new WhoDB();

const users = whodb.ontology('User');

const user = await users.get('u_123');
const active = await users.list({ where: { status: { eq: 'active' } }, pageSize: 100 });
await users.create({ email: '[email protected]' });
await users.createMany(rows, { idempotencyKey: 'import-42' });
await users.update('u_123', { plan: 'pro' });
const orders = await users.followLink('u_123', 'orders');

// Behavior-managed workflow:
const order = whodb.ontology('Order');
const capabilities = await order.capabilities('order_123');
await order.previewAction('approve', 'order_123', { note: 'Looks good' });
await order.action('approve', 'order_123', { note: 'Looks good' }, {
  expectedVersion: capabilities.recordVersion ?? undefined,
  idempotencyKey: 'approve-order-123',
});
const history = await order.actionExecutions('order_123');

// Iterate everything, page by page:
for await (const page of users.list({ pageSize: 500 }).pages()) {
  console.log(page.rows.length);
}

// Datasets and sources:
const kpis = await whodb.dataset('weekly_kpis').rows();
const raw = await whodb.source('src_...').rows({ Kind: 'Table', Locator: 'events' });

// Transforms: run a pipeline and wait for it to finish.
const rollup = whodb.transform('nightly-rollup');
const run = await rollup.run();
const finished = await rollup.wait(run.id, { timeoutMs: 300_000 });

// Functions: promote the draft so it can execute, then run it.
const normalize = whodb.function('normalize');
await normalize.promote('v1');                 // snapshot + set active production version
const result = await normalize.execute({ name: 'Ada' });
const queued = await normalize.startRun({ batch: 7 });
await normalize.wait(queued.id);

// Org administration (requires org manage rights):
const sa = await whodb.serviceAccounts().create('ci-deployer');
const { rawKey } = await whodb.serviceAccounts().createKey(sa.id); // shown once — store it securely
await whodb.lineageProviders().save({ name: 'marquez', endpoint: 'https://...', authType: 'none', enabled: true });
await whodb.sharing().share('ont_...', 'organization');

Authentication

Credential precedence:

  1. new WhoDB({ apiKey }) / { token } / { credentials } constructor options
  2. WHODB_API_KEY environment variable
  3. The whodb CLI's stored login (whodb login), gcloud-ADC-style — ideal for local development

Workspace (org / project) is optional with an API key; pass { project } or set WHODB_PROJECT when the key has access to more than one project.

Typed clients

Generate typed entity classes from your project's ontology:

whodb sdk generate --language ts --out src/whodb-gen/
import { createClient } from './whodb-gen/whodb.generated.js';

const { ontology } = createClient({ apiKey: process.env.WHODB_API_KEY });
const user = await ontology.User.get('u_123'); // fully typed

Versioning

Each SDK release is generated against one WhoDB platform release. Deprecated operations warn once per process with their removal date; operations removed from the platform raise WhoDBVersionError — upgrade the package to resolve.

License

Apache-2.0