Skip to content
briefkastencloud

Generic

Any HTTP POST with the source's secret becomes an event, for CI, cron jobs and your own services.

The generic adapter takes any webhook that can carry a shared secret. Use it for CI pipelines, cron check-ins, your own services, and providers without a built-in adapter.

Set it up

briefkasten source add generic --project acme-shop --name ci

Then post to the hook URL with the secret:

curl -X POST "$HOOK_URL" \
  -H "Authorization: Bearer $SECRET" \
  -H "x-briefkasten-event: deploy.finished" \
  -H "x-briefkasten-target: acme-shop" \
  -H "content-type: application/json" \
  -d '{"version":"v1.4.0","status":"succeeded"}'

Authentication

The source's secret, as Authorization: Bearer <secret> or in x-briefkasten-secret. A missing or wrong secret is refused with 401.

Events and targets

PartFrom
Eventthe x-briefkasten-event header; default hook
Targetx-briefkasten-target, else ?target=, else the path after the hook URL (…/hooks/acme-shop/ci/main → main), else hook
Bodythe JSON body, or { "text": … } for anything else
deploy.finishedA deploy script reports it finishedevent deploy.finishedtarget production
{
  "service": "acme-shop",
  "environment": "production",
  "version": "v1.4.0",
  "status": "succeeded",
  "durationSeconds": 94,
  "finishedAt": "2026-12-04T12:00:00.000Z"
}
cron.ranA cron job checks inevent cron.rantarget nightly-backup
{
  "job": "nightly-backup",
  "status": "ok",
  "bytes": 48211904,
  "ranAt": "2026-12-04T12:00:00.000Z"
}

Options

None.

In your app

import { generic } from "@briefkasten/adapter-generic";

const hooks = briefkasten({
  sources: { ci: generic({ secret: process.env.CI_WEBHOOK_SECRET }) },
});

hooks.on("ci:deploy.finished", async (event) => {
  console.log(event.body.version);
});