@cool-ai/beach-channel-webhook
v0.1.1
Published
Beach webhook channel — inbound event triggers over HTTP. Implements core's ChannelAdaptor (inbound only).
Readme
@cool-ai/beach-channel-webhook
The webhook channel adaptor: an inbound-only trigger. An external system POSTs an event, the adaptor builds an InboundRequest carrying the body as channel-blind data, and hands it to the channel-router. A trigger fires work; it does not answer a caller, so there is no reply path — send is a no-op and the request carries no reply destination.
It implements core's ChannelAdaptor so it registers with the channel-router uniformly, but only its inbound side does anything.
Use
import { WebhookChannelAdaptor } from '@cool-ai/beach-channel-webhook';
const webhook = new WebhookChannelAdaptor({
inbound: (req) => channelRouter.inbound(req),
});
app.post('/hooks/deploy', webhook.handler()); // acks 202, routes the bodyIf the posted body carries a threadId, it keys the conversation; otherwise the channel id is used. Pass an authenticator to verify a shared-secret or HMAC header at the boundary.
