Browse documentation

Migration and reference

Node.js SDK reference

Explore the server-side @yanola/whatsapp client, resources, request options, errors, retries, and webhook helpers.

DevelopersAdvancedAvailable

What this guide covers

  • Initialize WhatsAppClient once with an API key and optional request settings.
  • Use messages, senders, templates, media, events, usage, and webhook resources.
  • Pass AbortSignal and explicit idempotency keys when your application owns them.
  • Include the exported SDK version and request ID in sanitized support reports.

Identify the exact SDK release

The SDK exports YANOLA_SDK_VERSION and includes the same value in its default User-Agent. Record the exported version with a failing request ID so Yanola can distinguish release-specific patterns without collecting credentials or message content.

Safe runtime diagnostics
ts
import {
  WhatsAppClient,
  YANOLA_SDK_VERSION,
} from "@yanola/whatsapp"

const yanola = new WhatsAppClient({
  apiKey: process.env.YANOLA_API_KEY!,
})

console.info({
  component: "yanola-whatsapp",
  sdkVersion: YANOLA_SDK_VERSION,
})

Build a safe support report

  1. Preserve the same logical operation's request ID and idempotency key across application-owned retries.
  2. State whether the issue reproduces in Test Mode and whether any Live send or Yanola Balance is affected.
  3. For asynchronous sends, include the latest public message, event, webhook delivery, and usage states instead of treating a 202 response as final delivery.
Support report fields
IncludeNever include
SDK version, UTC timestamp, environment, endpoint or operation nameAPI key, Authorization header, Meta token, or webhook signing secret
Request ID and public msg_, msg_test_, evt_, del_, usg_, or resv_ IDsRecipient lists, full message bodies, or raw retained provider payloads
Sanitized error type, code, status, retryable flag, and bounded detailsSigned media URLs, unredacted response bodies, or database credentials

Diagnose delivery and billing safely

  1. Use webhookDeliveries.list or retrieve to inspect status, attempts, response status, and the redacted response preview.
  2. Replay only a terminal failed or canceled delivery after correcting the endpoint, and provide an application-owned idempotency key.
  3. Keep reserved and needs_reconciliation usage visible as unsettled. Never infer a final charge or create a replacement send while provider acceptance is uncertain.
  4. Escalate repeated endpoint timeouts, non-2xx patterns, reconciliation-needed states, or depleted Balance with the safe support fields above.