Developer guides
Baileys WhatsApp Library vs a Hosted WhatsApp API
Baileys WhatsApp library explained: what it does, what production use takes, and when a hosted WhatsApp API like Hypersender is simpler.


Baileys is an open-source TypeScript library that connects to WhatsApp the way WhatsApp Web does, over a WebSocket, without a browser. Many WhatsApp bots and self-hosted APIs, Evolution API included, run on it. This guide explains what the Baileys WhatsApp library gives you, what you build around it for production, and when a hosted API like Hypersender is less work.
What Baileys does
Baileys logs in as a linked device, with a QR code or a pairing code, and then sends and receives messages through WhatsApp's multi-device protocol. It's MIT-licensed TypeScript, maintained by the community under WhiskeySockets.
A minimal sender looks like this:
import makeWASocket, { useMultiFileAuthState } from "baileys";
const { state, saveCreds } = await useMultiFileAuthState("auth_info");
const sock = makeWASocket({ auth: state });
sock.ev.on("creds.update", saveCreds);
// After you scan the QR code:
await sock.sendMessage("201000000002@s.whatsapp.net", { text: "Hello from Baileys" });That's enough for a script on your laptop. A business that depends on it needs more.
What production on Baileys takes
| Piece | What you build or run |
|---|---|
| Session storage | Keep the login keys safe and restore them after restarts, usually in a database instead of files |
| Reconnection | Detect a dropped connection or a logout and recover, or alert someone |
| Queueing and pacing | Send at a human pace and retry without sending twice |
| Media | Download and store the images, voice notes and files people send |
| Webhooks | Turn socket events into HTTP calls your other services can use |
| Hosting | A Node.js process running all the time, with monitoring |
| Upgrades | Follow WhatsApp's protocol changes. Baileys 7 shipped breaking changes, for example |
The maintainers are also clear about use. The README says they discourage bulk or automated messaging and that following WhatsApp's terms is the user's responsibility.
When to use Baileys
- You want full control of the code and the data.
- You're building something WhatsApp Web can do that no hosted API offers.
- It's a personal project or an internal tool, and an outage isn't urgent.
- Your team knows Node.js well and has time to maintain it.
When a hosted API is simpler
Hypersender runs that whole table for you. You connect your number by scanning a QR code in the dashboard, then call a REST API and receive webhooks.
curl -X POST "https://app.hypersender.com/api/whatsapp/v2/{instance}/send-text" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"chatId": "201000000002@c.us", "text": "Hello from Hypersender"}'Note the chat ID: Hypersender uses @c.us where Baileys uses @s.whatsapp.net.
What you get without building it:
- Requests are queued and checked with a request ID, and
send-text-safepaces messages and shows typing first. - Webhooks for incoming messages and delivery receipts, with webhook logs to see and resend failed calls.
- SDKs for Laravel, Node.js, Python and Go.
- Alerts when Meta limits a number: message capping and timelock restrictions, with the time left.
- SMS from your own Android phone and an OTP API on the same account.
The price is flat, from $9.99 per number per month. See WhatsApp API pricing.
To be clear: Hypersender also connects your number as a linked device. It isn't Meta's official platform, and neither is Baileys, so the same rules about who you message and how fast apply. The difference is who maintains the connection.
Baileys, Evolution API or Hypersender
| Baileys | Evolution API | Hypersender | |
|---|---|---|---|
| What it is | A library you code against | A REST API you host | A hosted REST API |
| You run | Your app and its storage | A server, a database and Redis | Nothing |
| Protocol updates | You upgrade and fix | You update the server | Handled for you |
| Cost | Your server and time | Your server and time | From $9.99 per number a month |
Evolution API vs a hosted WhatsApp API compares the middle option in more detail.
Moving a Baileys bot to Hypersender
- Connect the same number in the Hypersender dashboard by QR code. Log the Baileys session out first, so the number has one connection to manage.
- Replace
sock.sendMessagecalls with thesend-textrequest, or a call from one of the SDKs. - Replace
sock.ev.on("messages.upsert")with a webhook handler for themessage.anyevent. Build a WhatsApp bot in Python shows a complete handler.
Start a free Hypersender trial: 14 days, up to 100 messages a day, enough to move one flow and compare.





