Documentation Index
Fetch the complete documentation index at: https://docs.flowsbuilt.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
ChurnKit signs every webhook payload with HMAC-SHA256 using your webhook secret. Always verify the signature before processing the payload. The SDK exportsverifyWebhookSignature as a standalone function — no ChurnKit instance required.
Signature
Parameters
The raw, unparsed request body as a string. Do not parse it as JSON before passing it here — the signature is computed over the raw bytes.
The value of the
X-ChurnKit-Signature header. Format: sha256=<hex>.Your webhook signing secret from the FlowsBuilt Console.
Examples
Next.js App Router
Express
Hono (Cloudflare Workers)
How the signature is computed
ChurnKit computes:verifyWebhookSignature performs the same computation and compares with a constant-time comparison to prevent timing attacks.
Common mistakes
Parsing JSON before verifying
Parsing JSON before verifying
The signature is over the raw bytes. If you call
JSON.parse() before verifying, the comparison will fail because JSON serialization can change whitespace and key order.Using a body parser middleware
Using a body parser middleware
Express’s
express.json() middleware consumes and parses the body. Use express.raw() for webhook routes instead.Missing the secret in environment
Missing the secret in environment
If
process.env.CHURNKIT_WEBHOOK_SECRET is undefined, verification always returns false.
Check your environment variables and ensure the secret is set.