Getting started

Installation

wapi-cloud is published on npm and works with any Node.js 18+ project, TypeScript or JavaScript, ESM or CJS.

Requirements

  • Node.js 18 or later
  • A Meta developer app with the WhatsApp product added, plus a verified WhatsApp Business Account (WABA)
  • A permanent or system-user access token — see the Graph API docs for generating one

Install the package

npm install wapi-cloud

Or with your package manager of choice:

yarn add wapi-cloud
pnpm add wapi-cloud
bun add wapi-cloud

Import it

wapi-cloud ships as both ESM and CJS builds with bundled type declarations, so both import styles work out of the box.

ESM / TypeScript
import { Whatsapp } from "wapi-cloud";
CommonJS
const { Whatsapp } = require("wapi-cloud");
No build step is required to use wapi-cloud in a TypeScript project — types are resolved automatically from the package's .d.ts files.

Environment variables

wapi-cloud doesn't read environment variables for you — pass credentials explicitly to the constructor. A typical .env looks like this:

.env
WA_TOKEN=EAAG...
WA_PHONE_ID=123456789012345
WA_WABA_ID=987654321098765
WA_APP_SECRET=your_meta_app_secret
WA_APP_ID=your_meta_app_id
WA_BUSINESS_ID=your_meta_business_manager_id
WA_VERIFY_TOKEN=a_string_you_choose

Continue to Quick start to wire these into a working client.