/** * Helpers for receiving and verifying Notion webhook deliveries. * * Event signatures use HMAC-SHA256 with the subscription's verification * token. The `X-Notion-Signature` header contains `sha256=`. * Pass the raw body as received. Parsing and re-serializing JSON can change * its bytes and invalidate the signature. * * The helpers use `globalThis.crypto.subtle` when available, then fall * back to the Web Crypto API in Node's crypto module. */ export type VerifyWebhookSignatureArgs = { /** * The raw HTTP request body, before any parsing. * Pass a string for text bodies or a Uint8Array/Buffer for binary-safe * access. Re-serialized JSON will not verify. */ body: string | Uint8Array; /** * The value of the `X-Notion-Signature` request header. Verification * fails (returns false) if this is missing or malformed. */ signature: string | null | undefined; /** * The verification token configured for this webhook subscription * (returned by Notion when the subscription was created and surfaced * during the initial handshake). */ verificationToken: string; }; /** * Verify that a webhook delivery came from Notion and has not been * tampered with. * * Returns `true` if the signature matches HMAC-SHA256 of the body using * the verification token. Returns `false` for a missing or malformed * signature. Crypto errors may throw. */ export declare function verifyWebhookSignature(args: VerifyWebhookSignatureArgs): Promise; /** * Compute the value Notion would send in `X-Notion-Signature` for a * given body and verification token. Use this to test webhook handlers * without a live subscription. */ export declare function signWebhookPayload(args: { body: string | Uint8Array; verificationToken: string; }): Promise; //# sourceMappingURL=webhooks.d.ts.map