Skip to content

signPolarPayload

function signPolarPayload(
secret,
body,
options?
): Promise<Record<"webhook-id" | "webhook-timestamp" | "webhook-signature", string>>;

Defined in: src/billing/polar.ts:163

Build Standard Webhooks headers for body the way Polar signs it (tests, local tooling). legacy: true signs with the pre-2026-09-08 “Polar HMAC” key.

Parameter Type
secret string
body string
options? { id?: string; legacy?: boolean; timestamp?: number; }
options.id? string
options.legacy? boolean
options.timestamp? number

Promise<Record<"webhook-id" | "webhook-timestamp" | "webhook-signature", string>>