A light-weight, production-ready NestJS communication router designed to unify multiple messaging channels into a single, standardized API. This adapter allows businesses to integrate WhatsApp, Telegram, Slack, Teams, and Email with ease, bypassing high-cost third-party providers by deploying directly on their own infrastructure.
- Zero Middle-man Fees: Directly integrate with official APIs (like WhatsApp Cloud API) without paying message surcharges to third-party platforms.
- Local Deployment Support: Full support for local development and self-hosted production environments using standard infrastructure (PostgreSQL, Redis).
- Unified Schema: Normalize all incoming and outgoing messages into a consistent
GenericMessageformat, regardless of the source channel. - Automated Webhook Management: Built-in
ngrokintegration and automated Meta webhook registration for zero-config developer setups. - High Reliability: Powered by BullMQ for robust background processing, retries, and dead-letter queue management.
| Channel | Inbound | Outbound | Status |
|---|---|---|---|
| WhatsApp Cloud API | ✅ | ✅ | Production Ready |
| Telegram | 🏗️ | 🏗️ | Skeleton Ready |
| Slack | 🏗️ | 🏗️ | Skeleton Ready |
| Microsoft Teams | 🏗️ | 🏗️ | Skeleton Ready |
| Email (SMTP/SendGrid) | 🏗️ | 🏗️ | Skeleton Ready |
- WhatsApp Cloud API Integration: Full support for text, images, videos, and attachments.
- Media Persistence: Automatically downloads and serves media sent via WhatsApp locally.
- Intelligent Routing: Rule-based engine to fan-out messages to multiple destinations.
- Idempotency: Built-in duplicate suppression for inbound webhooks.
- Static Asset Serving: Built-in support to serve downloaded attachments for webhook consumers.
- Framework: NestJS + TypeScript
- Database: PostgreSQL (via Prisma ORM)
- Queue Layer: Redis + BullMQ
- Tunneling: Official
@ngrok/ngrokfor local development
- GET
/health: Returns the health status of the application and its dependencies.
- GET
/messages: List all normalized messages stored in the database. - POST
/messages/send: Send an outbound message.- Body:
{ "channel": "whatsapp", "to": { "phone": "1234567890" }, "type": "text", "text": "Hello world" }
- Body:
- GET
/whatsapp/webhook: Used by Meta to verify your webhook endpoint. - POST
/whatsapp/webhook: Receives inbound messages and status updates from WhatsApp.
Copy .env.example to .env:
cp .env.example .envTo get your API keys (Meta App ID, Secret, WhatsApp IDs, and Ngrok Token), follow our Step-by-Step Meta Setup Guide.
Start the required Redis and PostgreSQL services:
docker compose up -dpnpm install
pnpm prisma generate
pnpm prisma migrate dev --name init# Development
pnpm start:dev
# Production
pnpm build
pnpm start:prodThis project is proudly supported and maintained by:
| Sponsor | Website |
|---|---|
| Zynapte | www.zynapte.com |
We welcome contributions! To get started:
- Fork the repository.
- Create a feature branch:
git checkout -b feature/amazing-feature. - Commit your changes:
git commit -m 'Add some amazing feature'. - Push to the branch:
git push origin feature/amazing-feature. - Open a Pull Request.
Please ensure your code adheres to the project's Prettier and ESLint configurations.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Built with ❤️ for the open-source community. Stop paying for every message, start own-hosting your communication stack.
