Checks the signature and age of a webhook delivery and returns the parsed body.
Throws WebhookVerificationError when the delivery must be rejected.
Type Parameters
T = unknown
Parameters
payload: string|Uint8Array<ArrayBufferLike>
the raw request body, exactly as received (do not parse and re-serialise it),
as a string or as bytes (a Node.js Buffer is a Uint8Array, so it can be passed as is)
Checks the signature and age of a webhook delivery and returns the parsed body. Throws WebhookVerificationError when the delivery must be rejected.