Template

WhatsApp Cloud API webhook (Node.js)

Verification handshake, X-Hub-Signature-256 validation, acknowledge-first handling, deduplication and text or button replies.

Download ZIP (7.0 KB)

SHA-256: 6d8b6b1af02c5f9140802afb708870f683d3649a03069daeb57227cf92d5f2ac (checksum file)

Stack: Node.js 20+, no dependencies · License: MIT · Files: 10

What it includes

Verification handshake, X-Hub-Signature-256 validation, acknowledge-first handling, deduplication and text or button replies.

File tree

whatsapp-node/
├── src/
│   ├── server.js
│   └── whatsapp.js
├── tests/
│   └── whatsapp.test.js
├── .dockerignore
├── .env.example
├── .gitignore
├── Dockerfile
├── LICENSE
├── package.json
└── README.md

Setup

unzip whatsapp-node.zip && cd whatsapp-node
cp .env.example .env
npm run dev
npm test

Fill in .env with credentials from the platform's official developer console. Never commit it: the included .gitignore excludes it.

Run with Docker

docker build -t whatsapp-node .
docker run --rm --env-file .env whatsapp-node

Official documentation

https://developers.facebook.com/docs/whatsapp/cloud-api

All templates