WebhookReceiver is for customers using push mode: when your product is configured with a forward_url, the connector POSTs events to your endpoint as JSON. WebhookReceiver handles signature verification, JSON parsing, and dispatching to typed callbacks — giving you the same ActionsPayload / SummaryPayload interface that SSE users get from AsyncConnectorClient.
Use it when you want the connector to push events to your server rather than your server pulling from the SSE stream.
How push mode works
X-Connector-Signature header for verification:
Setup (FastAPI)
Setup (Flask / sync)
Constructor
HMAC-SHA256 signing secret configured on the connector (
integration_config.secret).
Pass an empty string to skip verification — useful in development but not recommended
in production.Sync or async callback called for every
actions event. Can also be registered
via .on_actions(fn) after construction.Sync or async callback called for every
summary event. Can also be registered
via .on_summary(fn) after construction.Builder interface
Both callback registration methods returnself for chaining:
Core methods
await .handle(body, signature_header) — async
Verify, parse, and dispatch. Use with FastAPI, Starlette, aiohttp, or any async framework.
ValueError if the signature is invalid. Returns the parsed ActionsPayload or SummaryPayload, or None if the event type is unrecognised.
.handle_sync(body, signature_header) — sync
Same behaviour but synchronous. Use with Flask, Django, or any sync framework. Callbacks must be synchronous.
.verify(body, signature_header) → bool
Check the HMAC-SHA256 signature without parsing or dispatching.
.parse(body) → ActionsPayload | SummaryPayload | None
Parse raw bytes into a typed payload without verifying the signature or dispatching callbacks.
API reference
| Method | Returns | Description |
|---|---|---|
.on_actions(fn) | self | Register actions callback (sync or async) |
.on_summary(fn) | self | Register summary callback (sync or async) |
await .handle(body, sig) | AnyPayload | None | Verify + parse + dispatch (async) |
.handle_sync(body, sig) | AnyPayload | None | Verify + parse + dispatch (sync) |
.verify(body, sig) | bool | HMAC signature check only |
.parse(body) | AnyPayload | None | Parse bytes to typed payload, no verification |