The signing secret, verification limits, and key rotation configuration.
Verifies, decodes, and dispatches a request.
Accepts a Fetch API Request, or the framework-independent
WebhookRequestParts for frameworks that expose method, URL,
headers, and body separately. The body is read from a clone, so the caller
can still read the original request body afterwards.
The incoming request, or its framework-independent fields.
An optional cancellation signal for the body read. Ignored for WebhookRequestParts, which is already in memory.
A response with the resulting status and an empty body. This
method never rejects for protocol failures: 204 accepted, 400
malformed, 401 bad signature, 413 body too large, or 500 when a
listener throws.
Registers a listener for one event type.
Listeners for the same event run in registration order. The payload type is inferred from the event name.
The event type, for example eventType.inboundEmail.
The listener to invoke after the request is verified.
This handler, so registrations can be chained.
Verifies, decodes, and dispatches mxRaven webhook requests.
Register one or more listeners with WebhookHandler.on and feed the request to WebhookHandler.handle. Fetch-native runtimes pass the
Requestdirectly; other frameworks pass method, URL, headers, and raw body separately. Listeners for an event run sequentially in registration order, and the request is only acknowledged after every listener resolves, so a thrown error produces a500and mxRaven retries the delivery.Protocol failures are reported through the returned status and never thrown:
204accepted,200reserved for duplicates,400malformed request,401bad signature,413body too large, and500when a listener throws.A handler is safe for concurrent use; listeners must be too, because a handler may run for several requests at once.
Example