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

@dojocoding/whatsapp-sdk

v0.9.0

Published

Typed TypeScript SDK for Meta's WhatsApp Cloud API, opinionated for agentic use cases (LLM orchestrators, multi-turn bots, multi-tenant deployments, transactional pipelines). Sibling package: @dojocoding/whatsapp-mcp.

Readme

@dojocoding/whatsapp-sdk

Typed TypeScript SDK for Meta's WhatsApp Cloud API. Modular, spec-driven via OpenSpec, opinionated for agentic shapes — LLM orchestrators, multi-turn bots, slot-collection flows, transactional pipelines, multi-tenant deployments.

Sibling package: @dojocoding/whatsapp-mcp. Use this SDK directly when you're building a server (webhook receiver, multi-tenant API, queue worker). Use the sibling MCP server when you're wiring an LLM agent to send WhatsApp messages. Use both together for the agent ↔ customer loop — see docs/cookbook/hybrid/agent-handoff-loop.md.

Install

pnpm add @dojocoding/whatsapp-sdk
# or: npm install @dojocoding/whatsapp-sdk

Peer deps (all optional — only pull the ones whose subpath you import):

pnpm add express   # for @dojocoding/whatsapp-sdk/express
pnpm add hono      # for @dojocoding/whatsapp-sdk/hono
pnpm add ioredis   # for @dojocoding/whatsapp-sdk/storage/redis
pnpm add pg        # for @dojocoding/whatsapp-sdk/storage/postgres
pnpm add @opentelemetry/api   # for OTel spans

Use

A 30-line outbound + inbound scaffold:

import express from "express";
import {
  InMemoryStorage,
  WebhookReceiver,
  WhatsAppClient,
  WindowTracker,
} from "@dojocoding/whatsapp-sdk";
import { createWhatsAppMiddleware } from "@dojocoding/whatsapp-sdk/express";

const storage = new InMemoryStorage();
const windowTracker = new WindowTracker({
  phoneNumberId: process.env.WHATSAPP_PHONE_NUMBER_ID!,
  storage,
});
const client = new WhatsAppClient({
  phoneNumberId: process.env.WHATSAPP_PHONE_NUMBER_ID!,
  wabaId: process.env.WHATSAPP_BUSINESS_ACCOUNT_ID!,
  token: process.env.WHATSAPP_ACCESS_TOKEN!,
  appSecret: process.env.WHATSAPP_APP_SECRET!,
  windowTracker,
});

const receiver = new WebhookReceiver({
  appSecret: process.env.WHATSAPP_APP_SECRET!,
  verifyToken: process.env.WHATSAPP_VERIFY_TOKEN!,
  storage,
});
receiver.on("message", async (event) => {
  await windowTracker.notifyInbound(event.from);
  if (event.message.type === "text") {
    await client.sendText({ to: event.from, body: `You said: ${event.message.text}` });
  }
});

const app = express();
app.use("/webhooks/whatsapp", createWhatsAppMiddleware({ receiver }));
app.listen(3000);

What this package is / is NOT

  • Is: a typed client for every outbound WhatsApp Cloud API endpoint (sendText, sendImage, sendTemplate, sendInteractive, ...) + a webhook receiver with HMAC verification + dedupe + 24-hour-window tracking + framework adapters for Express, Hono, and the web fetch standard.
  • Is: opinionated about agentic concerns — typed errors with discriminator codes, observability hooks for OpenTelemetry, pluggable Storage for window / dedupe state (in-memory / Redis / Postgres).
  • Is NOT: an MCP server. To put this SDK in front of an LLM agent (Claude Desktop, Agent SDK), install the sibling @dojocoding/whatsapp-mcp.
  • Is NOT: a media upload helper. client.uploadMedia() exists, but for most flows pass a public link to send tools and let Meta fetch.

Docs

docs/sdk/ on GitHub.

Cookbook recipes: docs/cookbook/sdk/ (inbound auto-responder, two-way support, transactional, appointment booking, multi-tenant, Workers, Hono).

License

MIT © Dojo Coding LLC.