Skip to content

WebhookHandlerApi

Defined in: src/resources/webhook-handler-core.ts:106

The object returned by createWebhookHandler.

handleDelivery(rawBody, signatureHeader, options?): Promise<WebhookDeliveryResult>

Defined in: src/resources/webhook-handler-core.ts:115

Verifies, parses and dispatches one raw delivery body.

WebhookRawBody

string | undefined

WebhookRequestOptions

Promise<WebhookDeliveryResult>


handleRequest(request, options?): Promise<Response>

Defined in: src/resources/webhook-handler-core.ts:121

Handles a fetch-style Request (GET handshake or POST delivery) and returns a Response.

Request

Omit<WebhookRequestOptions, "tenant">

Promise<Response>


handleVerification(query, options?): WebhookVerificationResult

Defined in: src/resources/webhook-handler-core.ts:110

Answers the GET handshake from a query map or URLSearchParams.

Record<string, string | undefined> | URLSearchParams

WebhookTenant

WebhookVerificationResult


on<N>(name, handler): () => void

Defined in: src/resources/webhook-handler-core.ts:108

Registers a handler for an event name. Returns a function that removes it.

N extends keyof WebhookEventMap

N

WebhookHandlerFn<N>

() => void

Independent open-source project. Not affiliated with, endorsed by or sponsored by Meta or WhatsApp. Released under the MIT licence. Source on GitHub.