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

@octroi/ingest

v0.1.1

Published

Octroi cloud event client: batches events to ingest.octroi.sh, and polls signed remote config.

Readme

@octroi/ingest

The Octroi Cloud client: batches events to the ingest API, and polls signed route config.

BSL 1.1, unlike the rest of the SDK. Nothing MIT in this repo depends on it — @octroi/express loads it lazily as an optional peer — so a standalone install has no BSL code in its tree, which is what §1.1 requires.

Events

import { createIngestClient } from "@octroi/ingest";
import { octroi } from "@octroi/express";

const cloud = createIngestClient({ apiKey: process.env.OCT_KEY! });

app.use("/v1/report", octroi({ …, sinks: [cloud.sink] }));

Or let the adapter do it: octroi({ …, apiKey: process.env.OCT_KEY }).

Delivery is exactly §7: HTTPS, gzip, at-least-once, flush at 5s or 100 events, a 10k-event retry buffer, drop-oldest on overflow with a gate.error reporting the loss.

Three properties worth knowing:

  • sink never blocks and never throws. It appends to an array and returns. Every network cost is on a timer, because the request path must not pay for telemetry.
  • At-least-once means resends carry the same event ids, and the server is idempotent by id. That is what stops a network hiccup from inventing revenue.
  • The overflow report is not buffered. It rides with the next batch. Held in the buffer it would both steal a slot from a real event and — worse — be droppable by the next overflow, losing the very notice that says data was lost.

A 4xx is discarded rather than retried (a bad key will never succeed, and retrying forever means never sending anything again); 5xx and 429 retry with exponential backoff and then give up, loudly, rather than growing without bound.

Signed remote config

const config = createRemoteConfigClient({
  apiKey: process.env.OCT_KEY!,
  publicKey: process.env.OCT_CONFIG_PUBKEY!,   // pinned, hex
});
config.start();

app.use("/v1/report", octroi({
  price: remotePrice({ config, local: "$0.004" }),
  …
}));

This is the only thing in the SDK that lets a remote party change what you charge, so it refuses more than it accepts:

| Refused | Why | | --- | --- | | bad signature | an attacker who can answer the request must not set your prices | | key from the response | a key fetched from the server it authenticates is not a key — it is pinned by you | | stale config | otherwise replaying an old signed response reverts a price rise forever | | far-future config | would otherwise pin a config indefinitely |

On any refusal the previous good config stands, and if none ever verified, your local price applies. There is no state in which a route becomes unpriced — and therefore none in which it becomes free — because the cloud had a bad day.

configSource: "local" makes code authoritative and remote config purely observational (§3.1).

Self-hosting

url points anywhere. services/ingest in this repo is a working implementation of the §8 API, and the client's own tests run against it.