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

@revdesk/sdk

v0.2.2

Published

Official typed TypeScript SDK and revdesk CLI for the RevDesk v1 API.

Readme

@revdesk/sdk

Official typed TypeScript client for the RevDesk v1 API — phone numbers, calls, SMS, caller IDs, caller trust, usage, and sub-entities. Types are generated directly from the RevDesk OpenAPI spec, so request and response shapes always match the live API.

npm

Install

npm install @revdesk/sdk
# or: bun add @revdesk/sdk

Requires Node 18+ (uses the global fetch). Works in any modern runtime; pass a custom fetch if your environment doesn't provide one.

Quickstart

import { RevDesk } from "@revdesk/sdk";

const revdesk = new RevDesk({ apiKey: process.env.REVDESK_API_KEY! });

// List phone numbers
const { data: numbers } = await revdesk.phoneNumbers.list({ limit: 25 });

// Place an outbound call
await revdesk.calls.dial({ from_number: "+15551230000", to_number: "+15554560000" });

// Send an SMS
await revdesk.sms.send({ from: "+15551230000", to: "+15554560000", message: "Hi!" });

CLI

The package also installs the revdesk command. Use it for scripts and one-off API calls without writing a client:

export REVDESK_API_KEY="rv_…"
npx @revdesk/sdk request GET /v1/me
npx @revdesk/sdk request GET '/v1/calls?limit=10'
npx @revdesk/sdk request POST /v1/sms/send --data '{"from":"+14155550100","to":"+14155550101","message":"Hello"}'

Run npx @revdesk/sdk --help for the complete command reference. The CLI reads credentials only from REVDESK_API_KEY and sends them in the Authorization header.

AI agents

Every number you buy gets a RevDesk AI agent wired up to answer it automatically. List your agents, read which number each answers, and capture an agent's id to steer calls:

// Discover your agents
const { data: agents } = await revdesk.agents.list();

// Point an outbound call at a specific agent
await revdesk.calls.create({ phoneNumber: "+15554560000", assistantId: agents[0].id });

// Reassign which agent answers an inbound number
await revdesk.phoneNumbers.update(phoneId, { agent_id: agents[0].id });

// Talk to an agent straight from the browser (pair with @revdesk/webrtc)
const { data: call } = await revdesk.agents.webCall(agents[0].id);
// → { token, room_url, … } → hand to RevDeskRoom

listAll() iterates every agent across all pages.

Configuration

new RevDesk({
  apiKey: "…", // required
  baseUrl: "https://api.revdesk.com", // optional override
  fetch: customFetch, // optional fetch implementation
  headers: { "X-App": "my-app" }, // optional headers on every request
});

Pagination

List endpoints that support cursors return { data, meta: { cursor } }. Use listAll() to iterate every page automatically:

for await (const number of revdesk.phoneNumbers.listAll()) {
  console.log(number.phone_number);
}

listAll() is available on phoneNumbers, agents, subEntities, and callerTrust.reputation.numbers.

Idempotency

Mutating calls accept an idempotencyKey so a retried request is processed once. Use generateIdempotencyKey() or supply your own:

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

await revdesk.sms.send(
  { from: "+15551230000", to: "+15554560000", message: "Hi!" },
  { idempotencyKey: generateIdempotencyKey() }
);

Error handling

Every non-2xx response throws a RevDeskError with structured fields:

import { RevDeskError } from "@revdesk/sdk";

try {
  await revdesk.calls.dial({ from_number: "+1555…", to_number: "+1555…" });
} catch (err) {
  if (err instanceof RevDeskError) {
    console.error(err.code, err.status, err.message);
    if (err.fields) console.error("field errors:", err.fields);
    if (err.docUrl) console.error("see:", err.docUrl);
    if (err.isRetryable) {
      /* rate-limited or 5xx — safe to retry */
    }
  }
}

Browser calling

To place calls from the browser, issue a token with this SDK and hand it to @revdesk/webrtc:

const { data } = await revdesk.webrtc.getToken({
  from_number: "+15551230000",
  to_number: "+15554560000",
});
// → pass data.token to `new RevDeskRTC({ token })` from @revdesk/webrtc

License

MIT