Node.js · Next.js · Express
Send WhatsApp messages from Node.js
No npm package needed — the built-in fetch in Node 18+ is all it takes. Works the same in Next.js route handlers, Express, NestJS, serverless functions and Bun.
- From Ksh 500/month
- No per-message fees
- Pay with M-Pesa
- 2 min
- from sign-up to first message
- Ksh 500
- a month, no per-message fees
- 10,000
- recipients per bulk campaign
- M-Pesa
- pay by STK push, in shillings
Send a WhatsApp message in Node.js
Drop this into any async function.
- 1. Link a number. Sign up, open Numbers and scan the QR code with WhatsApp on your phone.
- 2. Create an API key. Keys start with wl_live_. Store it in an environment variable such as WAVELINK_KEY.
- 3. Send. POST to /api/v1/messages with to and text. You get back the message ID and status.
- 4. Listen. Add a webhook to receive delivery, read and reply events in your Express or Next.js app.
const res = await fetch("https://wavelink.co.ke/api/v1/messages", {
method: "POST",
headers: {
Authorization: "Bearer wl_live_...",
"Content-Type": "application/json",
},
body: JSON.stringify({
"to": "254712345678",
"text": "Hello from Node.js 👋"
}),
});
const data = await res.json();Frequently asked questions
Still unsure? Read the docs or try it free — it takes two minutes.
Do I need an npm package to use the WhatsApp API in Node.js?
No. The API is plain HTTPS and JSON, so the fetch function built into Node.js 18 and later is enough. Axios or any other HTTP client works too.
How do I verify webhooks in Express?
Read the raw request body with express.raw({ type: "application/json" }), compute an HMAC-SHA256 of it with your webhook secret, and compare it to the X-Wavelink-Signature header using crypto.timingSafeEqual. The docs include a complete example.
Can I send WhatsApp messages from a Next.js app?
Yes. Call the API from a route handler or server action so your API key stays on the server, never in the browser bundle.
Is there a free trial?
Yes. Every new account gets a 7-day free trial with all features, including the API, bulk campaigns, webhooks and the inbox. No card is needed to start.
Keep reading
Send your first WhatsApp message in two minutes.
7-day free trial, every feature included. Pay with M-Pesa when you are ready.
Create your free account