"use client"; import React, { useState } from "react"; import { BookOpen, ChevronDown, ChevronRight, Copy } from "lucide-react"; type EventType = { type: string; label: string; description: string; example?: unknown }; const RETRIES = "1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours"; const VERIFY_NODE = `// Node.js / Express — check the signature before trusting a request. const crypto = require("crypto"); const SECRET = process.env.CROSSEVENTS_WEBHOOK_SECRET; // whsec_… app.post("/crossevents-hook", express.raw({ type: "application/json" }), (req, res) => { const header = req.get("X-CrossEvents-Signature") || ""; // t=1767225600,v1=5f0c… const { t, v1 } = Object.fromEntries(header.split(",").map(p => p.split("="))); const body = req.body.toString("utf8"); // the raw body, unparsed const expected = crypto.createHmac("sha256", SECRET).update(\`\${t}.\${body}\`).digest("hex"); const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300; // within 5 minutes if (!fresh || !v1 || !crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected))) { return res.status(400).send("bad signature"); } const event = JSON.parse(body); // Deliveries can repeat: skip an event.id you've already handled. res.sendStatus(200); // answer quickly, then do the slow work handle(event); });`; const VERIFY_PHP = ` 300 || !hash_equals($expected, $sig['v1'] ?? '')) { http_response_code(400); exit('bad signature'); } $event = json_decode($body, true); http_response_code(200);`; function CopyButton({ text, label = "Copy" }: { text: string; label?: string }) { const [done, setDone] = useState(false); return ( ); } function Code({ text }: { text: string }) { return (
{text}
HTTP POST with a JSON body goes to that webhook's address. Everything is sent from the server; nothing comes from people's browsers.2xx status within 10 seconds, and the delivery is done.In Zapier, use Webhooks by Zapier → Catch Hook; in Make, use Webhooks → Custom webhook. Paste the address it gives you here, choose the events, then click Send test. The fields in the examples below become available to map into ChurchSuite, Planning Center, a spreadsheet, Mailchimp and so on.
Every request has the same envelope. data depends on the type (see the examples below).
| Field | Meaning |
|---|---|
id | The event's id (evt_…). It stays the same on retries, so use it to skip events you've already handled. |
type | The event type, e.g. registration.paid. The Send test button sends webhook.test. |
createdAt | When it happened (ISO 8601, UTC). |
data | The details. Amounts are in rand; dates are ISO 8601 in UTC. |
Headers:
Content-Type | application/json |
User-Agent | CrossEvents-Webhooks/1 |
X-CrossEvents-Event | The event type, the same as type. |
X-CrossEvents-Delivery | This delivery's id. Each webhook gets its own, and it's the same on retries. |
X-CrossEvents-Signature | t=<unix seconds>,v1=<signature>, explained below. |
Anyone who knows the address could post to it, so check the signature before acting on a request. v1 is the HMAC-SHA256, in hex, of t, a full stop, and the raw request body (<t>.<body>). It's keyed with the webhook's signing secret, the whsec_… shown once when you add the webhook or make a new secret.
Work it out on the raw body before parsing the JSON, compare in constant time, and reject a t more than 5 minutes old.
id to skip ones you've already handled.createdAt and the record's status, not the order they arrive in.items.https addresses on the public internet are allowed. Each webhook's log keeps what was sent for {keepDays} days.webhook.test · Sent by Send test. data is {`{ "message": "…" }`}, so your side can answer 2xx and ignore it.