verify
function verify(input): Promise<WebhookEnvelope>;Defined in: src/signing.ts:189
Verify an incoming Standard Webhooks request (from any compliant sender,
not just this package). Checks the timestamp tolerance, then compares every
v1, signature in the header against every candidate secret in constant
time. Returns the parsed envelope on success; throws
WebhookVerificationError otherwise.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
VerifyInput |
Returns
Section titled “Returns”Promise<WebhookEnvelope>
Example
Section titled “Example”import { verify } from "@xtandard/webhooks/signing";
const envelope = await verify({ payload: rawBody, headers: { "webhook-id": id, "webhook-timestamp": ts, "webhook-signature": sig }, secret: "whsec_…",});