Skip to main content

Node.js SDK

The official Node.js and TypeScript SDK gives you a typed client for the public WazzAPI surface. Use it to:
  • send direct WhatsApp messages
  • pair SDK usage with the public API for device inventory and sender selection
  • manage contacts, groups, and templates
  • verify signed WazzAPI webhook deliveries
  • download and decrypt WhatsApp media payloads

Package

Install the published package from npm.

Source code

Browse the SDK repository, examples, and release history.

Requirements

  • Node.js 20, 22, or 24
  • a WazzAPI account
  • a WazzAPI API key
If you plan to verify webhooks, also create a webhook secret in the dashboard.
Do not use this SDK in browser-side code. Keep your WazzAPI credentials on the server only.

Install

Choose the package manager that fits your stack:
npm
bun

Configuration

The SDK uses https://api.wazzapi.com by default. For most integrations, you only need:
  • WAZZAPI_API_KEY
For webhook verification, also set:
  • WAZZAPI_WEBHOOK_SECRET
.env

Quick start

Send a message

List devices

Verify incoming webhooks

Use WebhookHandler to validate the raw request body against the signature header before parsing JSON.
WazzAPI signs webhook deliveries with:
  • X-Wazzapi-Signature
  • X-Wazzapi-Event
  • X-Wazzapi-Event-ID
Supported event families include:
  • message events: message.received, message.sent, message.delivered, message.read, message.failed
  • device events: device.connected, device.disconnected

Handle API errors

When the API returns a non-success status, the SDK raises WazzapiAPIError.

Example scripts

The SDK repository includes ready-to-run examples:
  • examples/list-contacts.ts
  • examples/send-message.ts
  • examples/create-template.ts
  • examples/preview-template.ts
  • examples/verify-webhook.ts
  • advanced-examples/download-media.ts

Next steps

Quickstart

Create your API key and send your first live request.

API Reference

Explore endpoints and payloads behind the SDK methods.