chat-adapter-whatsapp-web.js
v0.0.1
Published
WhatsApp adapter for chat using whatsapp-web.js
Maintainers
Readme
chat-adapter-whatsapp-web.js
WhatsApp adapter for Chat SDK using whatsapp-web.js.
Installation
pnpm add chat-adapter-whatsapp-web.js whatsapp-web.jsUsage
import { Chat } from "chat";
import { Client, LocalAuth } from "whatsapp-web.js";
import { createWhatsAppAdapter } from "chat-adapter-whatsapp-web.js";
const client = new Client({
authStrategy: new LocalAuth(),
});
await client.initialize();
const bot = new Chat({
userName: "mybot",
adapters: {
whatsapp: createWhatsAppAdapter(client, "mybot"),
},
});
await bot.initialize();Features
- Receives incoming WhatsApp messages through
whatsapp-web.jsclient events - Sends, edits, and deletes messages
- Adds/removes reactions
- Sends typing indicator
- Fetches recent messages from a chat
- Converts incoming WhatsApp media to Chat SDK attachments
Notes
- This adapter does not expose webhook handling;
handleWebhookreturns501. - You are responsible for
whatsapp-web.jsclient lifecycle and authentication. - Thread IDs are encoded as
whatsapp:<base64url-chat-id>.
License
MIT
