Skip to content

feat: add WhatsApp Web support#104

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

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

Conversation

@samuelcorsan
Copy link
Copy Markdown

@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:
  • Media attachments

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
Copy Markdown
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
Copy Markdown

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
@nicopujia nicopujia mentioned this pull request Mar 1, 2026
1 task
@samuelcorsan
Copy link
Copy Markdown
Author

I released it as an external package while waiting for the PR to be reviewed: https://www.npmjs.com/package/chat-sdk-whatsapp-web

@bensabic
Copy link
Copy Markdown
Contributor

Thank you for your contribution, @samuelcorsan. As we now have a WhatsApp adapter, we'll be closing this PR. But please don't hesitate to contribute to other areas of the project, including with other adapters.

Thanks again.

@bensabic bensabic closed this Mar 22, 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.

2 participants