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

@zero.sc/sdk

v0.1.1

Published

Clients for the Zero services — drive, pay, talk and ai — with the server entry kept separate.

Readme


The problem this solves

Every service in an ecosystem gets called with fetch. It works, so it spreads — and then each call site grows its own timeout, its own retry, its own idea of what an error looks like. One of them logs the Authorization header while debugging and nobody notices for a year.

The dangerous version of that drift is quieter. Server credentials get read in a file that a client component imports three levels down, the bundler follows the graph, and a service token ships to the browser. Nothing fails. The build is green. The token is just there, in a JavaScript file anyone can open.

This package draws that line and then checks it with a test — a static walk of the import graph from the root entry. If a server module ever becomes reachable from it, the suite fails before anything is published.

Install

npm install @zero.sc/sdk

Zero runtime dependencies. react 19 is a peer, and only for the widgets — the server side needs nothing but Node.

Sixty seconds

Server side. Credentials come from the environment; nothing is hardcoded.

import { drive, news, notify } from '@zero.sc/sdk/server';

const session = await drive.createUploadSession({
  name: 'report.pdf',
  size: 4_096,
  mime: 'application/pdf',
});

await notify({ to: 'sub_123', template: 'upload-ready', channels: ['inapp', 'email'] });

const today = await news.digest('today', { country: 'kr' });

Client side. The widgets are ordinary React components.

'use client';
import { useState } from 'react';
import { DrivePicker } from '@zero.sc/sdk';

export function Attach() {
  const [open, setOpen] = useState(false);
  return (
    <DrivePicker
      open={open}
      onOpenChange={setOpen}
      onSelect={([file]) => console.log(file.name)}
    />
  );
}

onSelect receives a one-element tuple by default and an array when multiple is set — so single selection needs no nodes[0] and no check for an element the type says is there.

What's inside

| Namespace | Calls | Credential | |-----------|-------|------------| | drive | Upload sessions, presigned parts, completion | Service token | | pay | Subscription lookup, with a bounded cache | Service token | | talk | Notifications, with a best-effort variant | Service token | | news | Status, daily digest, story, search, trending | Optional key — anonymous works | | util | Tool and list catalogue | None |

And three widgets on the client entry: DrivePicker, CheckoutButton, AssistantPanel.

Failure is one shape

Everything throws ZeroApiError. Network drops, timeouts, malformed JSON and application errors all arrive with a code, a status and details — so a caller writes one catch rather than four.

import { isZeroApiError, retryAfterSeconds } from '@zero.sc/sdk';

try {
  await news.search({ q: 'zero' });
} catch (error) {
  if (isZeroApiError(error) && error.code === 'rate_limited') {
    const wait = retryAfterSeconds(error); // what the service asked for, in seconds
    if (wait !== undefined) await sleep(wait * 1000);
  }
}

Retry-After is read in both forms the HTTP spec allows — a delay in seconds and an absolute date. Implementations that only parse the number turn a date into NaN, and a NaN backoff is an immediate retry, which is precisely what the limit existed to prevent.

When a service returns 429, 503 or 408 without a machine-readable body, the status is promoted to rate_limited, unavailable or timeout so a switch still works. Statuses whose meaning belongs to the application are left as unknown_error — guessing a name there would collide with the real code the service adds later.

The contract it keeps

  • Secrets never reach a log. If a service echoes the token it received back inside an error message, it is removed before that error leaves the SDK.
  • Credentials never reach a URL. Keys go in headers, because query strings survive in access logs and referrer headers.
  • No retries, on purpose. Idempotency is the caller's knowledge, not ours. Retrying a charge because it timed out is not a helpful default.
  • Every call has a deadline. A request without a timeout does not fail; it hangs, which is worse.
  • Field names are the service's. Responses are not renamed to look tidier. A rename that drifts produces a silently empty value; an unchanged name produces a type error.

Honest limits

  • Five services, not the whole ecosystem. More exist than are wrapped here.
  • news and util are read-only. No key issuance, no writes.
  • No caching beyond one bounded subscription cache. Response lifetime is a policy decision, and it belongs to the app.
  • Widgets are unstyled beyond the shell tokens. They inherit; they do not theme.
  • This is 0.0.x. The error shape and the entry boundary are the stable parts. Individual service signatures follow their services.

Around it

| | | |---|---| | Docs | kit.zero.sc | | Sign-in | @zero.sc/auth-client | | Events between services | @zero.sc/events | | Components | @zero.sc/ui | | Everything | @zero.sc |

License

MIT OR Zero License v1.0 — take whichever you prefer. Choosing MIT is enough; nothing further is required of you.

The Zero name, marks and logos are not covered — build anything you like with this code, just don't present it as a Zero product.

Copyright (c) 2026 Zero. Source Code begins at Zero.