Changelog
v0.3.0
Section titled “v0.3.0”No public name is removed. The exported types are now aliases of the kit’s types, so declaration merging no longer works on them. Unknown STORAGE_DRIVER values now stop the CLI, and MySQL trailing-space collisions now throw. Details are under “Migration” below.
Changed
Section titled “Changed”@xtandard/webhooksis now built on@xtandard/kit, the shared building blocks of the xtandard products, as a regular dependency (^0.1.1). You never install or configure it. Every subpath, exported name, config shape, CLI command, env variable, HTTP route and stored-data format stays as it was; the storage drivers, auth/authorization providers, hooks runner, portal-token mechanics, panel/HTTP plumbing, framework adapters, CLI plumbing, admin-shell UI and build tooling are the kit’s, with the webhooks defaults passed explicitly (tablextandard_webhooks, Mongoxtandard_webhooks/webhooks_kv, pg channelxtandard_webhooks, realmxtandard-webhooks, thewhpt_prefix with a 7-day lifetime, base62 ids, readonly 403,__WEBHOOKS_CONFIG__, thextandard-webhooks:themekey and the.xtandard-webhooksscope).- Kit fixes reach you without a webhooks release. A kit patch is picked up on your next install.
The Docker image is the exception: it is rebuilt with the new kit by the Docker workflow’s
refresh-kitrun. - Every storage driver except unstorage and Cloudflare KV now has
compareAndSwap(file, sqlite, libsql, postgres, drizzle on pg/mysql/sqlite, mongodb, redis and RedisJSON), so the dispatcher’s generic claim path is atomic on all of them. The “dispatcher without atomic claiming” warning now only fires for unstorage and Cloudflare KV. claimDue(memory, redis) claims each delivery with a compare-and-swap.- The panel (
createFetchHandlerand every adapter result) has aclose()that stops the dispatcher it started. createPortalToken/verifyPortalTokenaccept a list of secrets for rotation: the first signs, any of them verifies. Keep the old secret until the longest-lived token signed with it has expired.mysqlWebhooksTable/pgWebhooksTableaccept akeyCollation(utf8mb4_0900_bin/utf8mb4_nopad_binon MySQL/MariaDB,"C"on Postgres) for new tables. The defaults are unchanged, sodrizzle-kitgenerates no migration.createFileStoragetakeslegacy("ignore"|"warn"(default, as before) |"read-through") andonLegacyfor stores written by v0.1.4 and earlier.createLogHooktakesjson: true(one JSON object per line) anddescribe(event).- The CLI:
--key=valueflags,AUTH_ROLE(the basic-auth user’s role, defaultadmin),{STORAGE,QUEUE}_SQLITE_TABLEand{STORAGE,QUEUE}_LIBSQL_URL; the banner shows the resolved path of afile:libSQL database. - Durations accept weeks (
"2w"). - The OpenAPI document’s
info.versionis the package version (it was hard-coded0.1.0). - The SPA accepts the portal token as
#token=…(preferred: the fragment never reaches servers or logs) as well as?token=…. - CI runs on the kit’s reusable workflows (
redis:8, so the RedisJSON conformance cases run; e2e and the examples typecheck on); the Docker workflow smoke-tests the image before pushing and can be re-run withrefresh-kit;release.ymlprepares through the kit and publishes itself. - Driver errors name the
@xtandard/webhooks/storage/<driver>import path.
Inherited from the kit (inventory §3; each has a permanent kit test):
- Unknown
STORAGE_DRIVER/QUEUE_STORAGE_DRIVERis an error (Unknown STORAGE_DRIVER "postgress" (expected one of: …)); a typo used to silently fall back to thefiledriver. - An empty env variable counts as unset (
PORT=in a.envfile now means the default, not""). - Re-validated path parameters: every application key, event type name and id in an admin API
path must match
KEY_REGEX, else 404. On MySQL (Drizzle,utf8mb4_bin, a PAD SPACE collation)DELETE /api/applications/acme%20used to act onacme. - MySQL trailing-space keys never cross: reads, removes and swaps match keys byte-exactly, and a
write whose key differs from a stored key only by trailing spaces throws
KeyCollisionErrorinstead of overwriting it. - MySQL (Drizzle):
getKeysno longer skips keys containing supplementary characters (emoji). - A malformed
%escape in an admin API path is a 404, not a 500. - The panel title is HTML-escaped in
index.html(and the base href, and U+2028/U+2029 in the bootstrap JSON). - The SPA’s
index.htmlis servedcache-control: no-cache, so an upgrade never serves a stale page that points at deleted hashed assets;/healthcheckanswers inside the panel ({ ok: true }) under any base path; a non-GET on a non-API path is 405 withAllow: GET, HEAD. - Portal SPA race: the shell waits for
/configbefore rendering the default route or running any admin query, and a portal token means portal from the first render, so a portal never fires admin requests. - The SPA removes
?token=/#token=from the address bar, so a portal link isn’t bookmarked, shared or sent inReferer. WebhooksPortalrefetches everything when itstokenchanges (a new token may carry a different application) and clears the token on unmount; the embed’srouting: "memory"keeps the query string (?app=).- Portal tokens reject an empty secret (on create and verify).
- Express adapter and the CLI’s Node server: every
Set-Cookieheader is kept, multi-value request headers are no longer joined, bodies already parsed byexpress.json()/urlencoded()are re-serialised correctly, responses stream with backpressure (they were buffered), the body is cancelled when the client disconnects, andHEADhas no body. - Elysia adapters:
PATCHandDELETEbodies are forwarded (they were dropped), a stalecontent-lengthis not, and two mounts with different prefixes are no longer de-duplicated by the plugin name. - Storage:
- Redis
watchno longer misses events under a prefix with glob characters;getKeysno longer returns duplicates (SCAN may repeat keys). - File
watchreports a write asupdate(it reported arenameasremoveeven when the file still existed); file writes are atomic (temporary file + rename). - Empty key segments are distinct keys on file and unstorage (
a//b≠a/b); unstorage keys ending in$are listed (unstorage hid them as meta keys). - Postgres and libSQL retry a failed connect/DDL instead of caching the failure.
- SQLite uses
GLOBfor prefixes (case-sensitive and index-usable); Mongo re-checksstartsWith, so a case-insensitive collection collation never leaks keys from another prefix. - Postgres/Drizzle/unstorage: a stored JSON string that looks like JSON (
"123") reads back as that string (it was parsed a second time into123). - Values are written as canonical JSON (sorted keys), so compare-and-swap is key-order-insensitive, and rows written by earlier releases still read, list and swap (structural fallback).
compareAndSwapcompares own properties only ({ a: undefined }is not{ b: undefined }) and tells{}from[].withWatch(...)results survive an object spread.
- Redis
- A thrown auth provider is still a 500 (unchanged), and a
Bearer whpt_…header is now recognised in any casing ofBearer. - JSON values must be finite:
NaN/Infinityin a metadata or schema field are a validation error (they used to be stored asnull); a valibot issue on the root object is reported at the base path without a trailing.. @xtandard/webhooks/storage/sqlitecan be imported under Node (opening a database still needs Bun); the SQLite table is created on first use instead of in the constructor.- The CLI runs when executed directly (
bun src/cli.ts) and never when imported.
Kit v0.1.1 also fixes behaviour this release would otherwise have regressed: the panel on Node
20.0–20.15, negative numbers as CLI flag values (--limit -1), and portal-token expiry under fake
timers all work as in v0.2.x. createFileStorage({ legacy: "read-through" }), new in this release,
reads through a legacy file only when the mapping is unambiguous.
(Already shipped in v0.2.1, now enforced by the kit: an unknown AUTH_MODE is an error, not an open
panel.)
Migration
Section titled “Migration”- Type-level:
WebhooksStorage,WatchableWebhooksStorage,CompareAndSwapWebhooksStorage,TransactionalWebhooksStorage,AuthProvider,Principal,AuthorizationProvider,AuthorizeInput,WebhooksHooks, the driver option types and the*WebhooksStorageresult types are now type aliases of the kit’s types (KvStorage, …) rather than interfaces.implementsand assignments work as before; declaration merging into them no longer does.PortalTokenErroris now a class value plus a type of the same name (new PortalTokenError(msg),instanceofanderr.name === "PortalTokenError"all still work).WebhooksDashboard/WebhooksPortalareReact.FCvalues withdisplayNames. TransactionalWebhooksStorageandisTransactionalare deprecated (no driver ever implemented them).- MySQL (Drizzle) users: a write that collides with a stored key differing only by trailing
spaces now throws
KeyCollisionError. The admin API cannot produce such keys; code calling the storage directly can. To keep such keys distinct, migrate the key column to a NO PAD collation (docs/STORAGE.md). STORAGE_DRIVERtypos and empty values: a value outside the documented list now stops the CLI and the image at startup instead of writing to./.webhooks. An emptySTORAGE_DRIVER=now means the default (file; the image setsmemory).- Validation message: an idempotency key outside
[a-zA-Z0-9._-]is reported asmust match /^[a-zA-Z0-9._-]+$/(it added(no slashes or path separators)); the dot-only and 256-character messages are unchanged. - Error message:
createFetchHandler({})throws aTypeError(createFetchHandler requires either `storage` or `core`.; it was anErrorwith a slightly different message). Driver peer-missing errors read@xtandard/webhooks/storage/<driver> requires the optional peer "<pkg>". Install it with: ….
v0.2.1
Section titled “v0.2.1”Security fix for the standalone server, the CLI and the Docker image: a mistyped AUTH_MODE no longer serves an open panel. Library APIs, storage and the HTTP API are unchanged.
🩹 Fixes
Section titled “🩹 Fixes”- auth: reject unknown
AUTH_MODEinstead of serving an open panel (#15). Any value other thannoneorbasic(a typo, wrong case) used to fall through tonone, leaving the admin panel and API unauthenticated. The server now exits withUnknown AUTH_MODE "x" (expected none or basic)before it listens. An empty or unsetAUTH_MODEstill meansnone, and now prints the same unauthenticated-panel warning as an explicitnone.
Migration
Section titled “Migration”None if AUTH_MODE is none, basic or unset. If a deployment fails to start after upgrading, its AUTH_MODE was invalid and the panel was open: set it to basic (with credentials) or none explicitly.
v0.2.0
Section titled “v0.2.0”Storage correctness across every backend (case-exact keys, literal prefixes), readable Elysia adapter types, a documentation site, and the xtandard brand kit. Two storage backends need a one-time migration: see below.
Migration
Section titled “Migration”Only these two setups need action; every other backend (Postgres, Redis, MongoDB, SQLite, libSQL, unstorage, Cloudflare KV, memory) upgrades with no migration.
-
File storage (
@xtandard/webhooks/storage/file): the on-disk layout changed. Key segments are now encoded into case-safe file names. After upgrading, stop every writer (app, dispatcher, worker) and run once:import { migrateFileStorage } from "@xtandard/webhooks/storage/file";await migrateFileStorage({ dir: "./data/webhooks" }); // → { moved: n }; idempotentUntil you do, files in the old layout are ignored (applications, endpoints and messages written by v0.1.x won’t be found), and
getKeyslogs a warning once. Details: File storage: case-safe file names. -
Drizzle storage on MySQL (
mysqlWebhooksTable()): re-collate thekeycolumn. New tables getutf8mb4_bin; a table created by v0.1.x keeps MySQL’s case- and accent-insensitive default until you run (with your table name andkeyLength, default512):ALTER TABLE xtandard_webhooksMODIFY `key` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL;It cannot fail on duplicates. Details: MySQL (Drizzle): a case-sensitive key column.
- File storage: keys that differ only by case shared a file on macOS and Windows (their default filesystems are case-insensitive), so applications such as
Acmeandacme, or ids differing only by case, overwrote each other. Each key segment is now encoded into a case-safe, reversible file name (Acme→^acme; characters outside[a-z0-9._~!@,=+_-]→%XX). Existing file stores need a one-time migration: runmigrateFileStorage({ dir })from@xtandard/webhooks/storage/fileonce, with no writer running. Until then, files in the old layout are ignored, andgetKeyslogs a warning once. - unstorage storage: distinct keys collided. unstorage normalizes keys: it cuts at
?, turns\and:into separators, and collapses repeats. The adapter now escapes%,?,\and:losslessly, andgetKeyshonours plain string prefixes that end mid-segment. Keys already stored that contain%(rare) are read under their escaped form. - Redis storage:
getKeystreated*,?,[,]in the prefix as glob patterns. They are now escaped inSCAN MATCH. - SQL storages (
sqlite,libsql,postgres, Drizzle):getKeyscould return keys that differ from the prefix by case. SQLite’sLIKEfolds ASCII case, and a non-binary collation can fold case or accents. Results are now filtered to exact, case-sensitive prefix matches. - Drizzle storage on MySQL:
getKeyswas a syntax error. It usedLIKE … ESCAPE '\'; in MySQL the backslash escapes the closing quote. It now usesESCAPE '!', which works on every dialect. Prefixes containing%,_or!match literally. - Drizzle storage on MySQL: keys that differ only by case or accent collided.
mysqlWebhooksTable()now declares thekeycolumn withutf8mb4_bin(MySQL’s defaultutf8mb4_0900_ai_cifolds case and accents), sowhk/Acme/…andwhk/acme/…are separate keys. Existing tables need a one-timeALTER TABLE: see MySQL (Drizzle): a case-sensitive key column.
- A documentation site: https://me.xantiagoma.com/xtandard-webhooks/ (guides, recipes and a generated API reference for every entry point).
WebhooksElysiaPlugin(from@xtandard/webhooks/elysiaand/elysia2): the named return type ofwebhooksElysia(), the same type as before. The API reference now shows it instead of the flattenedElysia<…, object & object & …>generics.
Changed
Section titled “Changed”- Brand: a generated vector kit in the xtandard family style (
docs/BRAND.md,scripts/brand-assets.sh): app icon, symbol, light/dark lockups, favicons and a social card. The README header, the docs site (logo, favicons,og:image) and the standalone admin UI (favicon; the mark before the default title) use only its SVGs. The raster logos (logo.png,logo-128.png,logo-256.png,favicon.png) are gone; rasters remain only where a format needs them (social.pngforog:image,apple-touch-icon.pngandfavicon.icoas<head>fallbacks). ElysiaWebhooksHandleris now an interface with documented members (a call signature,core,dispatcher,openapi()); the type itself is unchanged.- Docs: the
/elysia2API reference is generated against Elysia 2, and each module page lists the symbols it re-exports (e.g.webhooksPanelon/elysia2) with a link to where they are documented.
v0.1.4
Section titled “v0.1.4”Patch — the embedded React components now render in one theme and follow the host app.
theme="inherit"in a dark host left the embed light, with mixed themes. On a host that marks dark mode withclass="dark"on<html>, the panel stayed light and its headings inherited the host’s light text color on the panel’s white cards. Two scoping bugs in@xtandard/webhooks/react/styles.csscaused it: the dark tokens were scoped to a selector that could never match, and the panel’s own background/text color never applied to its wrapper. Each embed now resolves one theme and applies it to its own wrapper (data-theme), so surfaces, text, borders, popups, toasts and code views always come from one theme. The embed never writes to the host document.theme="inherit"now actually follows the host, live: adark/lightclass ordata-themeon<html>(then<body>), falling back toprefers-color-scheme. The panel’s theme switcher is hidden in this mode, since the host owns the theme.- Toasts in the embed now render inside the scoped wrapper, so they’re styled and themed.
- JSON code views take their syntax and editor colors from the theme tokens, so they’re readable in dark mode (embed and standalone SPA).
- Docs: the embed snippets used a non-existent
baseUrlprop; it’sapiBaseUrl.
theme="light"/theme="dark"force a theme on<WebhooksDashboard>/<WebhooksPortal>. Use it when the host tracks its theme in app state.detectHostTheme()and theEmbedTheme/ResolvedThemetypes are exported from@xtandard/webhooks/react.
Changed
Section titled “Changed”- With
theme="auto", the embed’s switcher now themes only the panel. Previously it also wrotedata-themeonto the host’s<html>.
v0.1.3
Section titled “v0.1.3”Elysia 2 support.
@xtandard/webhooks/elysia2— the Elysia adapter for Elysia 2 (elysia@rc). Elysia 2 takes routes as(path, hook, handler)and changed its class generics, so the typedwebhooksElysiaplugin from/elysiathrows on v2 and its types don’t reach Eden. The new subpath ships the same surface (webhooksPanel+webhooksElysia) built and typed against Elysia 2; pair it with@elysia/eden./elysiais unchanged for 1.x, and itswebhooksPanelmount handler works on both majors.- Docs: a
.wrap()+AsyncLocalStoragerecipe for request context in hooks and auth providers (docs/ADAPTERS.md).
Changed
Section titled “Changed”- Peer range
elysia: ^1.0.0 || ^2.0.0-0, so Elysia 2 prereleases satisfy it.
v0.1.2
Section titled “v0.1.2”Patch — fixes the React embed leaking its styles into the host app.
@xtandard/webhooks/react/styles.csswas a global, unscoped Tailwind build — its preflight element resets (*,button,h1,a, tables) and generic utilities (.flex,.border, …) restyled the entire host app, not just the embedded dashboard. Every rule is now scoped under the embed’s.xtandard-webhookswrapper (preflight and utilities included), with the design tokens re-homed onto the wrapper; a build guardrail fails if any rule escapes the scope. The standalone SPA bundle (dist/ui) is unchanged. Base UI portals (Select/Combobox popups, Dialogs) now render inside the wrapper too, so they stay styled under the scoped stylesheet.
v0.1.1
Section titled “v0.1.1”Patch — two fixes found integrating v0.1.0 downstream (Elysia + Drizzle/Postgres + Redis).
- Idempotency on jsonb/key-canonicalizing control stores.
publish()compared payloads with an order-sensitive serialization, so a control store that reorders object keys on round-trip (Postgresjsonb, Drizzle) turned an identical re-publish of a multi-key payload into a falseIdempotencyConflictError. The comparison is now canonical (recursively key-sorted) — order-insensitive and adapter-independent, while still detecting a genuinely different payload. - Panel claim-safety check with a prebuilt
core. When a core built with a splitqueueStorage(e.g. control in Postgres, queue in Redis) was passed aswebhooksPanel({ core }), the “no atomic claiming” warning read the panel’s options instead of the core’s queue storage and warned spuriously. It now readscore.options.queueStorage(the source of truth). Delivery was already claim-safe; only the warning was wrong. Additionally,storageis no longer required when acoreis supplied, and the handler throws clearly if neither is given.
v0.1.0
Section titled “v0.1.0”First public release — a self-hosted, embeddable, Standard Webhooks-compliant outbound-webhooks control plane (a Svix alternative as a library).
Highlights
Section titled “Highlights”- Control plane: applications, a global event-type catalog, and per-application endpoints, with signed delivery, secret rotation (with a grace window), enable/disable, audit log, and control-plane hooks (
beforeveto /afteroffload). - Delivery engine:
publish()is HTTP-free and never blocks on a down receiver; an in-process dispatcher owns retries (Svix-compatible schedule with jitter), dead-lettering, auto-disable, and replay. Lease-based claiming makes it crash-safe and multi-instance-safe (native on Redis/memory, compare-and-swap elsewhere). At-least-once; receivers dedupe onwebhook-id. - Standard Webhooks signing (symmetric v1), verified against the spec’s own reference vector. Receivers verify with the official
standardwebhookslibraries or the zero-dependency@xtandard/webhooks/receiver. - Pluggable storage over a four-method KV contract: memory, file, Redis (native queue claiming), Postgres, Drizzle (pg/mysql/sqlite), MongoDB, SQLite, libSQL, unstorage, Cloudflare KV. Control and delivery-queue planes can be split.
- Bundled admin SPA (mount in Elysia/Hono/Express/Bun; no React required in the host) with a full delivery inspector, plus a React embed exposing
<WebhooksDashboard>and the customer-facing<WebhooksPortal>scoped by signed portal tokens. - Auth & authorization: none/basic/delegated authentication, none/roles/delegated authorization, and force-scoped portal tokens.
- Testing tools:
@xtandard/webhooks/testing(in-memory core + verifying local receiver), thextandard-webhooks listeninspecting receiver, thesignsignature playground, and an in-panel request inspector. - Adapters, CLI, and a standalone Docker image, plus examples (including a polyglot interop proof against the official Python and Go libraries) and a seeded demo (
bun run demo).
ZeroVer: the API is stabilizing; minor versions may break, patch versions do not.