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

@sub-zero/sdk

v0.1.0

Published

Typed client for the SubZero /v2 API, validated against the shared wire contract

Readme

@sub-zero/sdk

Typed client for SubZero's /v2 API.

npm i @sub-zero/sdk
import { SubZeroClient, SubZeroError } from '@sub-zero/sdk';

const subzero = new SubZeroClient({ token: process.env.SUBZERO_TOKEN! });

// Filing an incident from a cron: the idempotency key means a retry, or a
// second delivery of the same job, returns the original ticket instead of
// filing another one.
try {
  const incident = await subzero.createIncident(
    {
      projectKey: 'ACME',
      subject: 'Nightly sync failed',
      description: 'ETIMEDOUT talking to the warehouse API.',
      service: 'ACME-CRON',
      priority: 'P2',
    },
    { idempotencyKey: `nightly-${new Date().toISOString().slice(0, 10)}` },
  );
  console.log(incident.code); // ACME-42
} catch (error) {
  if (error instanceof SubZeroError && error.code === 'PROJECT_NOT_IN_KEY_SCOPE') {
    // the key cannot write to that project; branch on `code`, never on the message
  }
  throw error;
}

// Paging is handled for you.
for await (const incident of subzero.incidents({ status: 'open', priority: 'P1' })) {
  console.log(incident.code, incident.subject);
}

What it does for you

Validates both directions. Requests are checked against @sub-zero/contract before they leave, so a bad payload fails in your process with the payload in hand rather than as a 400 from the server. Responses are checked as they arrive: a field that changes shape raises SubZeroResponseError instead of quietly handing you undefined.

Retries only where a retry is safe. Reads and writes carrying an Idempotency-Key are retried on a 429, a 5xx or a dropped connection, honouring Retry-After and backing off with jitter otherwise. A write without a key is never retried, because a repeat would file a second incident.

Errors you can branch on. SubZeroError carries code, status, requestId and details. 402 and 403 both mean "you cannot do this", and only one of them is fixed by buying more seats.

Options

| | | |---|---| | token | A project ingest key (szk_live_…) or a user session token. Required. | | baseUrl | Defaults to https://api.sub-zero.dev. | | timeoutMs | Per request, default 15000. | | maxRetries | Default 2. Applies only where retrying is safe. | | userAgent | Appended to the SDK's own, e.g. acme-cron/1.4. | | fetch | Swap in for tests or a proxy-aware implementation. |

Coverage

Every /v2 endpoint in the contract: createIncident, listIncidents, incidents (paging), getIncident, listProjects, createProject, updateProject, listProblems, createProblem.

Machine credentials cannot create projects or problems — that is the server's rule, and it will answer FORBIDDEN.