Astrada TypeScript SDK
    Preparing search index...

    Function constructWebhookEvent

    • Verifies a webhook delivery (as verifyWebhook does) and returns it as a typed event.

      The signature covers the delivery id, the timestamp and the body, not the webhook-event-type header that type comes from. Trust data (signed); treat type as a routing hint, and when the difference matters, check that data has the shape you expect (for example its _links.self).

      Parameters

      Returns WebhookEvent

      WebhookVerificationError if the signature or timestamp is refused, or the webhook-event-type header is missing

      WebhookPayloadError (a WebhookVerificationError) if the body is signed but is not JSON, not an object, or lacks a field its event type's payload requires

      RangeError for a configuration mistake (see verifyWebhook)