Skip to main content
Returns the hex HMAC-SHA-256 of a raw body under a shared secret.

Parameters

secret

string

body

string

Returns

Promise<string>

Remarks

This is the value sendEvent sends as X-Tappify-Signature, computed over the exact bytes of the body it posts. Call it directly only when you build the request yourself, and sign the serialised string you send rather than re-serialising the object, because a different key order is a different signature. Uses Web Crypto, so it runs on Node, Cloudflare Workers and Vercel alike.

Example