gitmyhub

multi-wa-api

TypeScript ★ 22 updated 10d ago

A server-side API for controlling multiple WhatsApp accounts at once. Send messages, receive events, and manage sessions via standard web requests, no direct app interaction needed. Supports multi-tenant setups with PostgreSQL-backed session storage.

TypeScriptPostgreSQLREST APIWebhooksMonorepoSDKsetup: hardcomplexity 4/5

This is a server-side API for programmatically controlling multiple WhatsApp accounts at the same time. Developers can use it to send messages, receive events, and manage WhatsApp sessions through standard web requests, rather than interacting with the WhatsApp app directly.

The project supports two underlying WhatsApp connection libraries, called engines, that can be chosen per session when it is created. Unusually, sessions can be switched from one engine to the other without going through the WhatsApp QR-code pairing process again. All session state for both engines is stored in a single PostgreSQL database, which means the data persists across restarts and is accessible from one place.

The system is built for multi-tenant use, meaning multiple separate teams or customers can each have their own isolated set of sessions under one running server. Security features include two authentication methods: API keys for server-to-server communication and short-lived tokens for human-facing interfaces. Incoming webhooks are signed with a cryptographic checksum so you can verify they actually came from this server.

When a new WhatsApp session is created, the API streams a QR code in real time that the user scans with the WhatsApp mobile app to link the account. After that, sending a message is a single web request. Events like incoming messages are delivered as webhooks to a URL you configure.

The codebase is structured as a TypeScript monorepo with clear internal boundaries. The core business logic does not depend on either engine directly, both engines are separate packages injected at startup. A typed SDK package is included for client-side use that removes the need to manually construct message payloads.

The README is written in Portuguese and the project appears to be in active early development.

Where it fits