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

@augstash/sdk

v0.2.0

Published

Node / TypeScript client for the Augstash messaging API

Readme

@augstash/sdk

Node / TypeScript client for the Augstash API. Not published yet - see ../README.md.

npm install            # dev dependencies
python ../tools/refresh.py --base-url http://localhost:8086 node   # generate the client
npm test
npm run build

Using it

import { AugstashClient, AugstashError, ContactApi, SmsApi, WalletApi } from '@augstash/sdk';

const client = new AugstashClient({
  baseUrl: process.env.AUGSTASH_BASE_URL!,   // required - there is no default host
  apiKey: process.env.AUGSTASH_API_KEY!,     // ask_live_<keyId>.<secret>
});

const wallet = await client.api(WalletApi).balance();

try {
  await client.api(SmsApi).sendSms({ sendSmsRequest: { to: '+919000000000', body: 'hello' } });
} catch (error) {
  if (error instanceof AugstashError && error.code === 'WALLET_INSUFFICIENT_FUNDS') {
    // branch on `code`, never on `message` - message is localized
    console.error(error.detail, error.traceId);
  }
}

client.api(X) takes any of the 154 generated API classes and hands back a cached, configured instance. There is no hand-written list of accessors: one would drift the moment an endpoint is added.

Paging

import { collect, paginateCursor, paginatePages } from '@augstash/sdk';

const contacts = client.api(ContactApi);
for await (const contact of paginatePages((page) => contacts.listContacts({ page, limit: 100 }))) {
  // ...
}

Use paginateCursor for message, conversation and event history - those endpoints are cursor-paged because an offset page over a table that grows at the top repeats and skips rows mid-scroll.

Webhooks

import { verifyWebhookSignature, SIGNATURE_HEADER } from '@augstash/sdk';

app.post('/hooks/augstash', express.raw({ type: 'application/json' }), async (req, res) => {
  const ok = await verifyWebhookSignature(secret, req.body, req.header(SIGNATURE_HEADER));
  if (!ok) return res.sendStatus(401);
  // req.body is the raw Buffer - `express.json()` would re-serialize and the check would fail
  res.sendStatus(204);
});

Options

| Option | Default | | |---|---|---| | baseUrl | - | required | | apiKey / bearerToken | - | one is required; a bearer token reaches endpoints a key cannot | | timeoutMs | 30000 | per attempt | | retry | 3 attempts, 0.5s-8s | {maxAttempts: 1} disables | | idempotency | true | off also stops mutating calls being retried | | headers, fetch, middleware | - | escape hatches |

Build notes

Compiled to CommonJS so both bundlers and plain Node consumers work without extension-ful imports; an ESM build is worth adding before publishing. src/generated/ is machine-written and gitignored - edit src/*.ts only.