krapio
Library referenceFunctions

verifyWebhook()

function verifyWebhook(
   rawBody, 
   signatureHeader, 
   secret, 
   options?
): Promise<boolean>;

true when the delivery was signed with the endpoint's secret and is not older than the tolerance. the body has to be the raw request body, re-serialized json gives a different signature. answer 401 when this is false, the signature check sends deliberately bad signatures and expects that

Parameters

ParameterType
rawBodystring | Uint8Array<ArrayBufferLike>
signatureHeaderstring | null | undefined
secretstring
options?VerifyWebhookOptions

Returns

Promise<boolean>

On this page