tys.webhooks.verifySignature()
Checks the signature only (throws when it does not verify). Use constructEvent() unless you parse the body yourself.
verifySignature( rawBody: RawBody, signatureHeader: string | string[] | null | undefined, secret: string, opts?: ConstructEventOptions, ): voidParameters
Section titled “Parameters”rawBodyRawBodyRequiredThe raw request body.
signatureHeaderstring | string[] | null | undefinedRequiredThe TYS-Signature header.
secretstringRequiredThe signing secret (whsec_…).
optsConstructEventOptionsOptionalProperties
toleranceSecondsnumber | undefinedOptionalMaximum |now − t| in seconds (default 300). 0 or less disables the check.
nownumber | Date | undefinedOptionalThe current time (unix seconds or a Date); for tests.
Example
Section titled “Example”tys.webhooks.verifySignature(rawBody, req.headers["tys-signature"], secret); // throws SignatureVerificationErrortryyoursize.Webhook.verify_signature(payload, sig_header, secret) # True, or raises SignatureVerificationErrorWas this page helpful?
Thank you. We read every answer.