Skip to content

sign

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

Defined in: src/signing.ts:114

Sign one delivery attempt with one secret: v1, + base64(HMAC-SHA256 over ${id}.${timestamp}.${body}). timestamp is unix seconds.

Parameter Type
secret string
id string
timestamp number
body string

Promise<string>

import { sign } from "@xtandard/webhooks/signing";
const signature = await sign(secret, "msg_…", 1720000000, body);
// "v1,K5oZ…"