Ir al contenido

tys.webhooks.verifySignature()

Esta página aún no está disponible en tu idioma.

Method@tryyoursize/node

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,
): void
rawBodyRawBodyObligatorio

The raw request body.

signatureHeaderstring | string[] | null | undefinedObligatorio

The TYS-Signature header.

secretstringObligatorio

The signing secret (whsec_…).

optsConstructEventOptionsOpcional
Propiedades
toleranceSecondsnumber | undefinedOpcional

Maximum |now − t| in seconds (default 300). 0 or less disables the check.

nownumber | Date | undefinedOpcional

The current time (unix seconds or a Date); for tests.

tys.webhooks.verifySignature(rawBody, req.headers["tys-signature"], secret); // throws SignatureVerificationError

¿Te ha resultado útil esta página?