Function signPayload

  • Compute the x-wabery-signature header value for a body (sha256=<hex>, HMAC-SHA256). Handy for local testing: sign a fake webhook / data-exchange payload and POST it to your own endpoint so you can exercise verification without deploying.

    Parameters

    • body: string | Buffer<ArrayBufferLike>
    • secret: string

    Returns string

    const body = JSON.stringify(event);
    await fetch(localUrl, { method: "POST", headers: { "x-wabery-signature": signPayload(body, secret) }, body });