Developer docs

Node.js SDK

Official WhatsApp Business API docs for Nexwapi — authenticate with your secret key from Developer Settings.

Official SDK for Node.js 18+. Send WhatsApp messages, manage contacts, and list templates with a few lines of code.

Install

bash
npm install nexwapi
# or from the monorepo
npm install ./sdk/nodejs

Quick start

bash
import Nexwapi from "nexwapi";

const client = new Nexwapi({
  apiKey: process.env.NEXWAPI_API_KEY,
});

await client.messages.sendText({
  to: "919876543210",
  text: "Hello from Nexwapi!",
});

await client.messages.sendTemplate({
  to: "919876543210",
  template: "otp_login",
  params: ["123456"],
});

const me = await client.account.get();
console.log(me.plan);

CommonJS

bash
const Nexwapi = require("nexwapi");
const client = new Nexwapi({ apiKey: process.env.NEXWAPI_API_KEY });

Methods

  • client.account.get()
  • client.messages.sendText({ to, text })
  • client.messages.sendTemplate({ to, template, params?, language? })
  • client.contacts.list / upsert / setOptIn
  • client.templates.list()

Environment

  • NEXWAPI_API_KEY — secret key
  • NEXWAPI_BASE_URL — optional, default https://api.nexwapi.com

Errors

Throws NexwapiError with status, code, and body.

Full HTTP reference: API docs · Postman