Astrada TypeScript SDK
    Preparing search index...

    Function parseStoredWebhookEvent

    • A delivery your server verified earlier and stored, read again: for replaying an event this SDK could not read when it arrived (a WebhookPayloadError), after you update the SDK. It checks no signature, so pass only what you stored after a successful check (constructWebhookEvent or verifyWebhook), never a body from a request; keep that record of the check with the body.

      Parameters

      • stored: {
            body: string | Uint8Array<ArrayBufferLike>;
            id: string;
            timestamp: string | number | Date;
            type: string;
        }

        the raw body as received (a string or bytes), and the delivery's webhook-event-type, webhook-id and webhook-timestamp (Unix seconds as a number or an all-digit string, a Date, or an ISO 8601 string with Z or an offset) as stored

      Returns WebhookEvent

      RangeError when type or id is empty, the timestamp is not valid, or the body is neither a string nor bytes

      WebhookPayloadError when the body is not JSON or not the shape this SDK knows for its type