Skip to content

signWebhook

function signWebhook(
secret,
id,
timestamp,
body
): Promise<string>;

Defined in: src/sinks/webhook.ts:106

Sign one message: v1, + base64(HMAC-SHA256(key, ${id}.${timestamp}.${body})). timestamp is unix seconds.

Parameter Type
secret string
id string
timestamp number
body string

Promise<string>

import { signWebhook } from "@xtandard/audit/sinks/webhook";
const signature = await signWebhook("whsec_…", "evt_…", 1_720_000_000, body); // "v1,…"