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

@thunderphone/sdk

v0.3.0

Published

Official typed ThunderPhone API client

Downloads

261

Readme

ThunderPhone TypeScript SDK

Node.js 18+. Install npm install @thunderphone/sdk. ESM and CommonJS are supported. Set THUNDERPHONE_API_KEY in your server's environment, or pass { apiKey } to the constructor. Keep this key out of browser bundles. Optional baseUrl defaults to https://api.thunderphone.com (do not append /v1).

import { ThunderPhone } from "@thunderphone/sdk";

const api = new ThunderPhone();
const agent = await api.agents.create({
  name: "Reception",
  prompt: "Help callers with scheduling and business information.",
  voice: process.env.THUNDERPHONE_VOICE!,
});
const call = await api.calls.place({
  agent_id: agent.id,
  from_number: process.env.FROM_NUMBER!,
  to_number: process.env.TO_NUMBER!,
  idempotency_key: "appointment-123",
});
const done = await api.calls.waitForCompletion(call.call_id, {
  timeoutMs: 300_000,
  pollIntervalMs: 1_000,
});
if (done.status === "failed") throw new Error(done.end_reason ?? "Call failed");
console.log((await api.calls.transcript(call.call_id)).transcripts);

Choose a voice from GET /v1/voices. Outbound calls require an outbound-capable carrier number, sufficient balance, and the organization's outbound confirmation. A failed call is a terminal result; polling returns it for the caller to inspect. waitForCompletion supports signal: AbortSignal and aborts on timeout. Writes are never retried automatically. Reuse an idempotency key only for the same request.

Every public operation is available through the typed api.client.GET, .POST, .PUT, .PATCH, and .DELETE methods:

const { data, error, response } = await api.client.GET("/v1/calls", {
  params: { query: { limit: 20, offset: 0 } },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);

Helpers throw ThunderPhoneError with status and body for API errors; transport errors propagate. The low-level client returns { data, error, response }. Types are exported as paths, operations, and components. Both interfaces send X-ThunderPhone-Client: sdk-typescript/0.3.0.

Verify webhook and tool-call signatures

Every request ThunderPhone sends to your server carries X-ThunderPhone-Signature-V2, a timestamped HMAC over the method, path, query and raw body. verifySignature checks it and rejects requests older than five minutes:

import express from "express";
import { verifySignature } from "@thunderphone/sdk";

app.post("/thunderphone-webhook", express.raw({ type: "*/*" }), (req, res) => {
  const ok = verifySignature({
    header: req.header("X-ThunderPhone-Signature-V2"),
    secret: process.env.THUNDERPHONE_WEBHOOK_SECRET!, // or an array while rotating
    method: req.method,
    path: req.originalUrl, // path and query exactly as received
    body: req.body, // the raw Buffer, before any JSON parsing
  });
  if (!ok) return res.sendStatus(401);
  res.sendStatus(204);
});

toleranceSeconds changes the 300-second window. computeSignature builds a signature for your own tests. The helpers use node:crypto. See Verify webhook signatures.

API reference · OpenAPI

Development: npm ci, npm test, npm run typecheck. Regenerate from the repository root with scripts/generate-sdks.sh; never hand-edit src/schema.ts.