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

@restlessai/sdk

v0.3.6

Published

Capture API traffic and send it to Restless. Works with Express, Fastify, Koa, Hono, Next.js, and the bare Node http server. Runs on Node, Bun, and Deno.

Downloads

1,217

Readme

@restlessai/sdk

Capture your API traffic and send it to Restless.

Supports Express, Fastify, Koa, Hono, Next.js, and bare Node http. Runs on Node 18+, Bun, and Deno.

Install

npx api setup

This scans your project, figures out your framework, generates an OpenAPI spec, wires the SDK into your server, and flags your custom auth fields for redaction.

Manual installation

If you'd rather wire it up by hand:

npm install @restlessai/sdk
const restless = require('@restlessai/sdk')(process.env.RESTLESS_KEY);

app.use(restless.setup((req) => ({
  apiKey: restless.mask(req.headers.authorization),
  project: {
    id: /* this user's unique project id */,
    enrich: async (id) => {
      // Lazy-resolved: runs once per project id, then cached.
      // Fill in with your own lookup (DB, JWT, API, etc.).
      //
      //   const project = await db.projects.findById(id);

      return {
        /*
          label: project.name,
          email: project.email,  // email or array of emails
        */
      };
    },
  },
})));

Here's how to set it up for your framework:

| framework | registration | |-----------|-----------------------------------------------------------------------| | Express | app.use(restless.setup(cb)) | | Fastify | await fastify.register(restless.setup(cb)) | | Koa | app.use(restless.setup(cb)) | | Hono | app.use(restless.setup(cb)) | | Next.js | export const GET = restless.setup(cb)(async (req) => { ... }) | | http | http.createServer(restless.setup(cb)(myHandler)) |

Full per-framework examples are in install.md.

What you get

  • One line of setup. The factory returns a client; setup(cb) gives you framework-ready middleware back.
  • Lazy project enrichment. Expensive DB lookups for project metadata (display name, contact emails, plan tier) run only on the first request from each project, then cache until the server asks for a refresh. 100 requests from the same project don't hit your database 100 times.
  • Safe by default. Headers like Authorization / Cookie and body fields like password / token / ssn are redacted before anything leaves your server. The redaction list extends itself from your OpenAPI spec: the npx api setup flow scans your auth mechanisms and flags custom fields automatically.
  • Error-triage built in. 4xx / 5xx responses get an x-log-url header and a debug block in the JSON body so you can jump straight to the captured log.
  • Blocking. Return { block: true } from the setup callback to reject a request with a 403 before your handler runs.

Environment variables

| variable | purpose | |----------------------|-------------------------------------------------------------| | RESTLESS_KEY | Your project API key. Used if you don't pass one explicitly. Auto-loaded from .env (walking up from cwd) if not already set. | | RESTLESS_BASE_URL | Override the metrics server URL (self-hosted / staging). | | DEBUG=restless | Print upload diagnostics to stderr. |

Docs

  • install.md: comprehensive installation reference. Framework examples, option tables, every gotcha. Structured so both humans and AI coding assistants can follow it.
  • docs/INTERNALS.md: how batching, blocking, redaction, and request ID generation actually work.

License

ISC