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

@omnistreams/sdk

v0.1.0

Published

Official TypeScript SDK for the OmniStream omnichannel CRM API — typed client with auth, pagination, retries, idempotency and webhook signature verification.

Readme

@omnistreams/sdk

Official TypeScript SDK for the OmniStream omnichannel CRM API. Types are generated from the published OpenAPI spec; the runtime adds auth, retries, pagination, idempotency and webhook verification.

Install

npm install @omnistreams/sdk

Requires Node.js ≥ 18 (uses the global fetch and Web Crypto).

Quick start

import { OmnistreamClient } from "@omnistreams/sdk";

const client = new OmnistreamClient({
  apiKey: process.env.OMNISTREAM_API_KEY!,        // create in Developer → API Keys
  baseUrl: "https://your-omnistream-host",         // default http://localhost:3000
});

// Typed resource helpers
const open = await client.conversations.list({ status: "open" });
const message = await client.conversations.sendMessage(open[0].id, {
  type: "text",
  content: { text: "Hi! How can I help?" },
});

Features

Auth

Every request sends your key as X-API-Key. Lock the key down with an IP allow list (Developer → API Keys) for server-to-server use.

Retries & rate limits

Failed requests are retried automatically with exponential backoff and full jitter. 429 responses honour the Retry-After header. Safe methods (GET) retry on network/5xx errors; unsafe methods only retry on 429 — unless you pass an idempotency key (see below).

const client = new OmnistreamClient({ apiKey, maxRetries: 3, timeoutMs: 15000 });

Idempotency

Pass an idempotency key so a POST can be safely retried on transient failures:

import { generateIdempotencyKey } from "@omnistreams/sdk";

await client.conversations.sendMessage(
  id,
  { type: "text", content: { text: "hi" } },
  { idempotencyKey: generateIdempotencyKey() },
);

Pagination

paginate() returns an async iterator that walks page-numbered list endpoints lazily:

import type { Contact } from "@omnistreams/sdk";

for await (const contact of client.paginate<Contact>("/api/contacts", { search: "acme" })) {
  console.log(contact.name);
}

Typed errors

import { OmnistreamApiError, OmnistreamNetworkError } from "@omnistreams/sdk";

try {
  await client.conversations.get("does-not-exist");
} catch (err) {
  if (err instanceof OmnistreamApiError && err.isNotFound) {
    // 404
  } else if (err instanceof OmnistreamNetworkError && err.timedOut) {
    // request timed out
  }
}

OmnistreamApiError exposes status, code, body, and helpers: isAuthError (401), isForbidden (403), isNotFound (404), isValidationError (422), isRateLimited (429), isServerError (5xx).

Webhook verification

Verify inbound webhooks signed by the gateway (X-Omnistream-Signature, HMAC-SHA256 hex). Works in Node, browsers and edge runtimes.

import { verifyWebhookSignature, verifyWebhookSignatureWithRotation } from "@omnistreams/sdk";

// rawBody must be the exact bytes received — verify BEFORE JSON.parse.
const ok = await verifyWebhookSignature(rawBody, req.headers["x-omnistream-signature"], secret);

// During a secret rotation, accept the current OR previous signature:
const okRotating = await verifyWebhookSignatureWithRotation(rawBody, secret, {
  current: req.headers["x-omnistream-signature"],
  previous: req.headers["x-omnistream-signature-previous"],
});

Low-level access

Every endpoint is reachable through the generic verbs, and the full generated OpenAPI types are exported:

import type { components } from "@omnistreams/sdk";
type Campaign = components["schemas"]["Campaign"];

const campaigns = await client.get<Campaign[]>("/api/campaigns", { page: 1 });
await client.request("DELETE", `/api/api-keys/${keyId}`);

Development

npm install
npm run generate   # regenerate src/generated/openapi.ts from ../../docs/openapi.yaml
npm run build
npm test

Regenerate the types whenever docs/openapi.yaml changes.