WebhookHandlerApi
Defined in: src/resources/webhook-handler-core.ts:106
The object returned by createWebhookHandler.
Methods
Section titled “Methods”handleDelivery()
Section titled “handleDelivery()”handleDelivery(
rawBody,signatureHeader,options?):Promise<WebhookDeliveryResult>
Defined in: src/resources/webhook-handler-core.ts:115
Verifies, parses and dispatches one raw delivery body.
Parameters
Section titled “Parameters”rawBody
Section titled “rawBody”signatureHeader
Section titled “signatureHeader”string | undefined
options?
Section titled “options?”Returns
Section titled “Returns”Promise<WebhookDeliveryResult>
handleRequest()
Section titled “handleRequest()”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.
Parameters
Section titled “Parameters”request
Section titled “request”Request
options?
Section titled “options?”Omit<WebhookRequestOptions, "tenant">
Returns
Section titled “Returns”Promise<Response>
handleVerification()
Section titled “handleVerification()”handleVerification(
query,options?):WebhookVerificationResult
Defined in: src/resources/webhook-handler-core.ts:110
Answers the GET handshake from a query map or URLSearchParams.
Parameters
Section titled “Parameters”Record<string, string | undefined> | URLSearchParams
options?
Section titled “options?”tenant?
Section titled “tenant?”Returns
Section titled “Returns”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.
Type Parameters
Section titled “Type Parameters”N extends keyof WebhookEventMap
Parameters
Section titled “Parameters”N
handler
Section titled “handler”Returns
Section titled “Returns”() => void
Independent open-source project. Not affiliated with, endorsed by or sponsored by Meta or WhatsApp. Released under the MIT licence. Source on GitHub.