Don't poll. Subscribe an HTTPS endpoint to the events you care about and we'll deliver them signed and retried.
| Event | Payload | Fires when |
|---|---|---|
| catalog.completed | job | A catalog upload finishes processing. |
| catalog.failed | job | A job stops with row errors above threshold. |
| trend.shift | signal | A tracked category changes momentum. |
Every delivery carries a Kibbe-Signature header: a timestamp and an HMAC-SHA256 of timestamp.body using your endpoint secret. Reject anything older than five minutes.
import { verifySignature } from "@kibbe/sdk";
export async function POST(req: Request) {
const body = await req.text();
const ok = verifySignature({
payload: body,
header: req.headers.get("kibbe-signature")!,
secret: process.env.KIBBE_WEBHOOK_SECRET!,
});
if (!ok) return new Response("bad signature", { status: 401 });
return new Response("ok");
}