Create a webhook handler that verifies and processes raw webhook requests.
An invalid signature is never dispatched — throwOnInvalidSignature only controls whether the failure throws (caught here as an error result) or is returned directly.
throwOnInvalidSignature
const handleWebhook = createWebhookProcessor({ signingSecret: process.env.CLOVER_WEBHOOK_SECRET!, handlers: { 'CHARGE': async (event) => { await fulfill(event); } },});const result = await handleWebhook(rawBody, signature); Copy
const handleWebhook = createWebhookProcessor({ signingSecret: process.env.CLOVER_WEBHOOK_SECRET!, handlers: { 'CHARGE': async (event) => { await fulfill(event); } },});const result = await handleWebhook(rawBody, signature);
Create a webhook handler that verifies and processes raw webhook requests.
An invalid signature is never dispatched —
throwOnInvalidSignatureonly controls whether the failure throws (caught here as an error result) or is returned directly.