Skip to content

Releases

v1.4.1

Choose a tag to compare

@solvejet-team solvejet-team released this 21 Nov 07:53
321989a

Added

  • retryMessageSends option on WhatsAppClientConfig (default false). Set it to true to retry message sends on 5xx, network and timeout failures as well as 429. Meta documents no idempotency for sends, so a retry can deliver a message twice.
  • AGENTS-CONSUMER.md is included in the npm package.
  • CI check of the packed package with Are the Types Wrong for the ., ./web and ./testing entry points.

Changed

  • Message sends (POST {phoneNumberId}/messages: every sender, sendRaw, mark-as-read and typing indicators) now retry on HTTP 429 only. A transient 5xx on a send now surfaces as an error by default, as do network failures and timeouts. Previously these were retried, which could send the same message twice. Set retryMessageSends: true to get the old behaviour. GET, DELETE and other POST requests keep the existing retry policy.
  • The Cloudflare Workers example now uses @cloudflare/vitest-plugin, the renamed successor of the deprecated @cloudflare/vitest-pool-workers.

Fixed

  • TypeScript projects using moduleResolution: node10 could not resolve types for @solvejet/whatsapp-cloud-api/web and /testing. package.json now has typesVersions for both. Runtime resolution is unchanged.
  • A request aborted through its signal is no longer retried.
  • A 200 response with a body that is not valid JSON is no longer retried.

v1.4.0

Choose a tag to compare

@solvejet-team solvejet-team released this 21 Nov 06:07
9f622a2

Added

  • createWebhookHandler: an event-driven webhook handler. handleVerification answers the handshake, handleDelivery(rawBody, signature) and handleRequest(request) verify X-Hub-Signature-256 over the raw bytes, parse the delivery and call handlers registered with on. Options: appSecrets (one secret or an array for rotation), verifyToken, resolveTenant, allowUnsigned, maxBodyBytes, maxEventAgeSeconds, dedupe, dedupeKey, ackMode, waitUntil, retryOnHandlerError, concurrency and onError.
  • Typed events and parseWebhookEvents: message, status, error, call, flow, template, account, group and unknown, each with a ctx (WABA ID, field, time, metadata, matching contact). Fields the SDK does not model arrive as unknown with the untouched value.
  • createMemoryDedupe and the WebhookDedupe interface, with default keys message:<id> and status:<id>:<status>.
  • @solvejet/whatsapp-cloud-api/web entry point with the handler, parsers, dedupe and verifySignatureAsync. It uses Web Crypto and imports nothing from node:*, so it runs on Cloudflare Workers, Deno, Bun and Node 20+ (all run in CI). Vercel Edge is documented but not run in CI.
  • @solvejet/whatsapp-cloud-api/testing entry point: signWebhookBody, buildWebhookPayload and createTestRequest for testing handlers in-process.
  • Incoming message types order, unsupported, edit and revoke, and interactive.type values product and call_permission_reply.
  • Helpers isKnownMessage, getUserKey and isStale.
  • verifySignature and WebhookHandler accept an array of app secrets, so an old and a new secret can both be valid during rotation.
  • allowUnsigned option for WebhookHandler and createWebhookHandler.
  • CI jobs that run the built web entry on Deno, Bun and Cloudflare workerd, and a Node 20 smoke test of every entry point as ESM and CJS.
  • Examples rewritten on createWebhookHandler, an edge-runtime example for Cloudflare Workers, a lower-level example, and documentation pages for the handler, edge runtimes and testing.

Changed

  • The IncomingMessage union has new members (order, unsupported, edit, revoke), and interactive.type is wider. Code that checks a switch on message.type for exhaustiveness with a never assignment no longer compiles until it handles the new cases or has a default branch.
  • Accepting a webhook body without an appSecret now emits a one-time process warning (WHATSAPP_WEBHOOK_UNSIGNED, or console.warn where process.emitWarning is missing). Behaviour is otherwise unchanged. Set allowUnsigned: true to silence it.
  • verifySignature and WebhookHandler now accept an array for the app secret (a widening). Version 1.3.x returned false or threw for an array. An empty array, an array with an empty string and an array with no matching secret still fail closed.
  • package.json exports uses separate types conditions for import and require for every entry point, and adds ./web and ./testing.

Deprecated

  • Accepting unsigned deliveries without allowUnsigned: true. Version 2.0 will require an explicit opt-out; set appSecret (or appSecrets) now.

v1.3.2

Choose a tag to compare

@solvejet-team solvejet-team released this 21 Nov 04:44
426e6bd

Metadata release. No code changes.

  • Documentation site: https://solvejet.github.io/whatsapp-cloud-api/ with guides for webhook signature verification, the hub.challenge handshake, templates, interactive messages, media, rate limits and the 24-hour window, framework recipes for Express, Next.js, Hono and Fastify, migration guides, and a generated API reference.
  • The package homepage now points to the documentation site, so the npm page links to it.

See the CHANGELOG.

v1.3.1

Choose a tag to compare

@solvejet-team solvejet-team released this 20 Nov 19:11
1793f8d

Security hardening for webhook verification and parsing, plus type and documentation fixes.

Security

  • Webhook verification now fails closed: verifySignature returns false for an empty or non-string secret (previously an empty key could produce a valid-looking check), and verifyWebhook/verifyWebhookQuery return 403 for an empty verify token.
  • The WebhookHandler constructor throws WhatsAppWebhookError when appSecret or verifyToken is present but undefined or empty, so an unset environment variable no longer silently disables verification. Omitting the appSecret key entirely still means no signature enforcement.
  • WebhookHandler.parse and parseWebhook reject bodies over 3 MiB (Meta's documented maximum) before parsing; configure with maxBodyBytes.
  • JSON parse errors no longer carry a fragment of the request body as cause.
  • Trailing slashes of baseUrl are trimmed in linear time (fixes a CodeQL polynomial-ReDoS finding).

Fixed

  • Byte bodies: Uint8Array, Buffer and ArrayBuffer now verify and parse.
  • Extractors no longer throw on very large arrays (RangeError near 125k elements) or on malformed shapes.
  • Examples and README now parse before responding, return text/plain for the verification challenge, and return 401 only for a bad signature.

Behavior change

  • extractMessages and extractStatuses read only the messages webhook field. Call status events from the calls field are no longer returned as message statuses; read them from parsed.raw.

Types

  • Optional additions only: played status, biz_opaque_callback_data, pricing.type/subtype, Click to WhatsApp referral, message context flags, and more. See the CHANGELOG.

Zero runtime dependencies. Requires Node.js 20+.

v1.3.0

Choose a tag to compare

@solvejet-team solvejet-team released this 20 Nov 18:51
419b8db

Added

  • Business-scoped user IDs (BSUIDs) and usernames. Webhook types gain optional user_id, parent_user_id and profile.username on contacts, from_user_id, from_parent_user_id and group_id on incoming messages, recipient_user_id and recipient_parent_user_id on statuses, plus a system message type. Every message sender accepts a { bsuid } recipient.
  • client.messages.sendRaw(body, options?) to send message shapes the SDK does not wrap yet, with the same retries, timeouts and typed errors.
  • examples/: Express, Next.js App Router, Hono and Fastify webhook servers (verify-token handshake and raw-body signature check) plus a send script. Typechecked in CI.
  • README rewrite (quickstart first, comparison, raw-body webhook troubleshooting, runtime support) and a docs/ folder for templates, Flows, Block, Calling and errors.

Changed

  • The default Graph API version is now v26.0 (was v23.0). apiVersion stays configurable.
  • wa_id, from and recipient_id stay typed string, but Meta may omit them in some username-based events. Do not assume they are always present.

Zero runtime dependencies. Requires Node.js 20+. See the CHANGELOG.

v1.2.1

Choose a tag to compare

@solvejet-team solvejet-team released this 09 Oct 17:57
a0471da

1.2.1

Changed

  • Documentation: added the Calling media plane (WebRTC/SIP) to the roadmap as an optional future helper. The Calling REST signaling and settings are implemented in client.calls; the real-time media layer remains the caller's responsibility for now.

No code or API changes. Published automatically from CI via npm OIDC trusted publishing with signed provenance.

v1.2.0

Choose a tag to compare

@solvejet-team solvejet-team released this 09 Oct 17:49
d79ab36

1.2.0

Added

  • Flows management via client.flows: create, list, get, update, updateJson (multipart FLOW_JSON upload), publish, deprecate, delete, listAssets, and getPreview for building and managing WhatsApp Flows on a WABA.
  • Block API via client.blocks: block and unblock (up to 1,000 users per request, with per-user success/failure results) and list (paginated blocklist). Only users who messaged your business in the last 24 hours can be blocked.
  • Calling via client.calls: getSettings/updateSettings to enable and configure the Calling API (status, call icon visibility, callback permissions, call hours, SIP), plus the REST call lifecycle — initiate, preAccept, accept, reject, and terminate.
    • Scope note: this wraps the Calling API's REST signaling and settings only. The real-time media layer (SDP offer/answer over WebRTC/SIP) is the caller's responsibility; SDP is passed through as opaque strings.

Published automatically from CI via npm OIDC trusted publishing with signed provenance.

v1.1.0

Choose a tag to compare

@solvejet-team solvejet-team released this 09 Oct 16:59
4eddec3

1.1.0

Discoverability release — no code or API changes.

Changed

  • Richer npm description and expanded keywords so the SDK surfaces in npm search and in search/LLM results for queries like "WhatsApp Cloud API TypeScript SDK", "send WhatsApp message Node.js", and "verify WhatsApp webhooks".
  • README: added a "Why this library" positioning section, a "What you can do" capability table, and an FAQ (how to send a message/template, verify webhooks, dependencies, supported Node.js versions, official-SDK clarification, error/rate-limit handling).

Published automatically from CI via npm OIDC trusted publishing with signed provenance.

v1.0.1

Choose a tag to compare

@solvejet-team solvejet-team released this 09 Oct 16:25
8a4bca5

1.0.1 — first stable release

The public API is now stable. This project follows Semantic Versioning: breaking changes will only ship in a new major version.

No functional changes from 0.5.0 — this release marks the existing feature set as stable.

1.0.0 is skipped: an old 1.0.0 was published to npm and later unpublished, and npm permanently reserves unpublished version numbers. 1.0.1 is the first stable 1.x release on npm.

The stable surface

  • Outbound messaging — text, media, location, contacts, templates, interactive (buttons, lists, CTA URL, flow, location request, product, product list, address message), reactions, mark-as-read, typing indicator; reply threading on every sender.
  • Inbound webhooks — verification handshake, signature validation, typed parsing (incl. nfm_reply) and status updates.
  • Media lifecycle — upload, URL resolution, download, delete.
  • Phone number & WABA management — client.phoneNumbers, client.waba.
  • Message-template management — client.templates (list/get/create/edit/delete).
  • Typed errors + WhatsAppErrorCode constants, and client-side validation of documented limits.

Published automatically from CI via npm OIDC trusted publishing with signed provenance.

v0.5.0

Choose a tag to compare

@solvejet-team solvejet-team released this 09 Oct 16:13
88aeeb8

0.5.0

Added

  • Message-template management via client.templates:
    • list — list templates on a WABA with field selection, paging, and name/status/category/language filters.
    • get — fetch a single template by ID.
    • create — create a template with typed header/body/footer/buttons components, named or positional parameters, category, and optional send TTL. Client-side validation enforces the documented limits (name charset/length, exactly one BODY component, text-length caps, ≤10 buttons) before the request.
    • edit — update an approved template's category/components (name and language are immutable; editing resets it to review).
    • delete — delete all language versions of a template by name, or a single version via hsm_id.
  • New template-management types, with the management component union exported as MessageTemplateComponent to avoid colliding with the existing send-side TemplateComponent.

The existing sendTemplate sender and its types are unchanged.

Published automatically from CI via npm OIDC trusted publishing with signed provenance.