Add a Generic Webhook / HTTP Adapter for Arbitrary Chat Platforms
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
Research direction
Start from the proposed Chat configuration and createGenericAdapter entry point, then review how the SDK currently represents inbound events and sends responses. Define the adapter's scope around webhook payload mapping, optional verification and filtering, and developer-provided outgoing HTTP behavior; done means a documented generic adapter can support arbitrary HTTP-capable platforms without platform-specific parsing.
Written by the indexing model from the issue text.
Description
Problem Statement
Many popular or emerging messaging channels do not yet have dedicated adapters in the SDK. Like -
- WhatsApp (via open-source HTTP bridges such as WAHA or Beeper)
- Meta Ray-Ban smart glasses (which surface conversations through Meta/WhatsApp channels)
- Telegram (via its webhook-capable Bot API)
- Matrix / Element
- Various self-hosted, enterprise, or niche messengers
- Any future or custom platform that supports inbound HTTP webhooks and can receive responses via HTTP POST
Without a generic mechanism, supporting these platforms requires either waiting for official adapter packages or forking/maintaining custom platform-specific integrations — which undermines the "write once, run anywhere" value proposition of the SDK.
Proposed Solution
Introduce a built-in generic webhook / HTTP adapter (or a lightweight "raw HTTP" adapter) in the core Chat SDK or as a first-party package (e.g., @chat-adapter/webhook or @chat-adapter/generic).
This adapter would allow developers to connect the same bot logic to any HTTP-capable platform by defining:
- How incoming HTTP payloads are parsed and mapped to Chat SDK events (e.g., extracting message text, sender ID, channel/thread info)
- How outgoing Chat SDK responses are transformed and sent back (e.g., via HTTP POST, specific JSON shape, headers, etc.)
Alternatives Considered
No response
Use Case
import { Chat } from "chat";
import { createGenericAdapter } from "@chat-adapter/generic"; // or built-in
const bot = new Chat({
userName: "mybot",
adapters: {
custom: createGenericAdapter({
// Core webhook handling
path: "/webhook/my-platform", // Vercel / server route
verification: {
secret: process.env.WEBHOOK_SECRET, // optional HMAC / token check
},
// Required mappings (examples)
incoming: {
getText: (payload) => payload?.message?.text || payload?.body,
getSenderId: (payload) => payload?.from?.id || payload?.sender,
getChannelId: (payload) => payload?.thread?.id || payload?.chatId,
// Optional: getMessageId, isFromBot, etc.
},
outgoing: async (channelId, content, options) => {
// Developer provides the send logic (fetch/axios/etc.)
await fetch("https://api.platform.com/messages", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.PLATFORM_TOKEN}` },
body: JSON.stringify({
chat_id: channelId,
text: content.text,
// ... platform-specific fields
}),
});
},
// Optional extras
platformName: "WhatsApp", // for logs/metrics
shouldHandle: (req) => req.headers["user-agent"]?.includes("WhatsApp"), // filter
}),
},
// ... other config (state, model, etc.)
});
Priority
Nice to have
Contribution
- I am willing to help implement this feature
Additional Context
No response
- Dominant language
- TypeScript
- Stars
- 2.5k
- Forks
- 355
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 42
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vercel/chat
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
X and Twitch: paragraphs inside a block quote are joined with no spacePossibly taken @abhiramshaji-cyber claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Maintainers usually reply within 1 day
Similar issues
-
db-d1-sqlite: upsert is aliased to updateOne, so payload.kv.set never inserts new keysPossibly taken @pcbeingused333 claimed this today. OpenBug db: d1-sqlite Payload OSS
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#19766 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
device-management-toolkit/sample-web-ui#3711 ·
Maintainers usually reply within 1 day
-
bug impact:low Team: SecuritySolution Team:Defend Workflows v9.6.0
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
elastic/kibana#306401 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
agentes-chat/agentes-chat#927 ·
Maintainers usually reply within 1 day
-
Closing a pinned tab jumps to the Tabs section instead of the next open pinned tabPossibly taken @seenimohamed claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ardia-browser/ardia#2769 ·
Maintainers usually reply within 1 day