Skip to content

feat: add WhatsApp Web support#104

Open
samuelcorsan wants to merge 4 commits intovercel:mainfrom
samuelcorsan:add-whatsapp-web-support
Open

feat: add WhatsApp Web support#104
samuelcorsan wants to merge 4 commits intovercel:mainfrom
samuelcorsan:add-whatsapp-web-support

Conversation

@samuelcorsan
Copy link

@samuelcorsan samuelcorsan commented Feb 25, 2026

Summary

Adds a WhatsApp Web adapter (@chat-adapter/whatsapp-web) for the Chat SDK. Uses whatsapp-web.js to connect via WhatsApp Web (Puppeteer) and handle messages, reactions, typing, and history.

Features

  • Send/receive text, markdown and files
  • Add/remove emoji reactions
  • Typing indicator via thread.startTyping()
  • Message history via adapter.fetchMessages()
  • Cards rendered as text fallback
  • DMs and group chats
  • Reply to message: adapter.replyToMessage(threadId, messageId, content) for native quoted replies
  • Media attachments: Lazy-loaded with mimeType/filename from downloadMedia(); send via thread.post({ markdown, files })

Limitations

  • No message editing (WhatsApp Web API)
  • No webhooks; handleWebhook returns status only
  • Requires a long-running Node process (not serverless)
  • Uses Puppeteer/headless Chrome

Environment Variables

Variable Required Description
WHATSAPP_SESSION_PATH No Session storage path (default: .wwebjs_auth)

Test Plan

  • Unit tests pass for adapter core (thread IDs, isDM, filtering config)
  • Unit tests pass for message filtering (blockedNumbers, allowedNumbers, allowedGroups, requireMentionInGroups)
  • Unit tests pass for markdown conversion (*bold*, ~strike~, etc.)
  • pnpm typecheck passes
  • pnpm check passes
  • pnpm knip passes
  • pnpm test passes
  • Manual testing with WhatsApp (QR scan, send/receive messages, media, reply)

@vercel
Copy link
Contributor

vercel bot commented Feb 25, 2026

@samuelcorsan is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@socket-security
Copy link

socket-security bot commented Feb 25, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedqrcode-terminal@​0.12.01001009575100
Addedwhatsapp-web.js@​1.34.69710010095100

View full report

@samuelcorsan samuelcorsan changed the title feat: add WhatsApp support feat: add WhatsApp Web support Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant