A library, not a service
bun add and the database you already have. No second deployment with its own Postgres and
Redis to operate, and no per-message pricing.
npm install @xtandard/webhooksA Svix alternative as a library: no per-message SaaS pricing and no separate service to operate. Your app publishes, a dispatcher inside your process (or a worker running the same library) delivers, and your customers manage their own endpoints through an embeddable portal. The wire contract is Standard Webhooks, so receivers verify with the official libraries in any language.
import { Hono } from "hono";import { webhooksPanel } from "@xtandard/webhooks/hono";import { createPostgresStorage } from "@xtandard/webhooks/storage/postgres";
// The admin UI + API, and an in-process dispatcher (`dispatcher: false` for a split worker).const webhooks = webhooksPanel({ storage: createPostgresStorage({ connectionString: process.env.DATABASE_URL }),});
const app = new Hono();app.route("/webhooks", webhooks);Adapters for Hono, Elysia (1 and 2), Express and Bun; storage on Postgres, Redis, MongoDB, SQLite, libSQL, Drizzle, unstorage, Cloudflare KV, files or memory. Quickstart →
const { core } = webhooks;
await core.createApplication({ key: "acme" }); // your customerawait core.upsertEventType({ name: "invoice.paid" }); // the catalogawait core.createEndpoint("acme", { url: "https://api.acme-customer.com/webhooks", // their receiver eventTypes: ["invoice.paid"],});
// The hot path: one write + fan-out, no HTTP, never throws because an endpoint is down.await core.publish("acme", { eventType: "invoice.paid", payload: { invoiceId: "inv_123", amount: 4200 }, idempotencyKey: "invoice-paid-inv_123", // safe to call twice});The dispatcher signs each delivery, retries on a schedule (5s, 5m, 30m, 2h, 5h, 10h) and dead-letters what never succeeds. Delivery & retries →
import { verifyWebhook } from "@xtandard/webhooks/receiver";
export default async function handler(request: Request) { const event = await verifyWebhook(request, process.env.WEBHOOK_SECRET!); // throws if invalid // event.type === "invoice.paid", event.data === { invoiceId, amount } return new Response("ok");}Zero dependencies, any WinterCG runtime, and it verifies any Standard Webhooks sender. Python,
Go, Ruby, Java, Rust and PHP receivers use the official standardwebhooks libraries unmodified.
Signing & verification →
// Your server, after your own auth:import { createPortalToken } from "@xtandard/webhooks";const token = await createPortalToken(process.env.PORTAL_SECRET!, customer.appKey);
// Your React frontend:import { WebhooksPortal } from "@xtandard/webhooks/react";import "@xtandard/webhooks/react/styles.css";
<WebhooksPortal apiBaseUrl="/webhooks" token={token} />;Customers manage their own endpoints and inspect their own deliveries inside your product, scoped by a signed token: no sessions, no proxy routes. Consumer portal →
import { createTestWebhooks, createTestReceiver, drainDeliveries } from "@xtandard/webhooks/testing";
const { core, dispatcher } = createTestWebhooks(); // in memory, dispatcher not startedawait core.createApplication({ key: "acme" });await core.upsertEventType({ name: "order.shipped" });const endpoint = await core.createEndpoint("acme", { url: "http://127.0.0.1:9/tmp" });const secret = (await core.getSecrets("acme", endpoint.id))[0]!.secret;
const receiver = await createTestReceiver({ secret, failFirst: 1 }); // exercise a retryawait core.updateEndpoint("acme", endpoint.id, { url: receiver.url });
await core.publish("acme", { eventType: "order.shipped", payload: { orderId: "o_1" } });await drainDeliveries(dispatcher); // no timers, no sleeps
receiver.received[0]?.type; // "order.shipped", signature verifiedawait receiver.close();A verifying local receiver and a deterministic tick()-driven dispatcher for your test suite.
Testing →
flowchart LR
subgraph host["your app process (or a split worker)"]
direction TB
APP["app code"] -- "publish()" --> CORE["<b>core</b><br/>applications · event types<br/>endpoints · messages"]
PANEL["<b>panel</b><br/>admin UI + API<br/>Hono · Elysia · Express · Bun"] --> CORE
DISP["<b>dispatcher</b><br/>claims due deliveries<br/>signs · retries · dead-letters"] --> CORE
end
CORE <--> DB[("your database<br/>Postgres · Redis · Mongo<br/>SQLite · Drizzle · KV …")]
DISP -- "signed POSTs<br/>webhook-id · webhook-signature" --> RX["customer endpoints<br/>/receiver or official<br/>standardwebhooks libs"]
PORTAL["<WebhooksPortal><br/>in your product"] -- "portal token" --> PANEL
publish() is one message write plus fan-out: it never makes an HTTP call. The dispatcher owns all
network I/O; leases make it crash-safe and safe to run on several instances, with at-least-once
delivery (receivers dedupe on webhook-id). Unmount the admin UI and delivery keeps working.
Architecture →
A library, not a service
bun add and the database you already have. No second deployment with its own Postgres and
Redis to operate, and no per-message pricing.
Standard Webhooks on the wire
HMAC-SHA256 v1 signatures, webhook-id/webhook-timestamp headers and zero-downtime secret
rotation, so receivers need nothing bespoke.
Never silently drops
Exponential retries with jitter, dead-letters with per-attempt HTTP detail, replay one at a time or in bulk, and auto-disable for endpoints that keep failing.
Self-serve for your customers
An embeddable portal, an admin dashboard, auth and role-based authorization, audit-ready hooks and a CLI with a local inspecting receiver.
@xtandard/webhooks has siblings: open-source, MIT-licensed projects that share the xtandard name.
Each one stands on its own.
All of them, with npm and GitHub links: the xtandard ecosystem.