Skip to content

Installation

  • Node.js 22+ (also supports Bun and Deno)
  • PostgreSQL 13+, MySQL, or SQLite
  • TypeScript 5+ (recommended, but not required)
  • An existing application with a supported ORM and framework
Terminal window
npm install @usebetterdev/webhooks

The main package (@usebetterdev/webhooks) includes the core library and all adapters via subpath exports. The CLI (@usebetterdev/webhooks-cli) is used via npx for generating migrations and managing webhook data — no installation required.

You need a database driver and (optionally) a framework. Install the ones you use:

Terminal window
npm install drizzle-orm pg
import { drizzleWebhookAdapter } from "@usebetterdev/webhooks/drizzle";
Terminal window
npm install hono

Requires hono >= 4.

import { betterWebhooksHono } from "@usebetterdev/webhooks/hono";

The CLI reads your database connection from the DATABASE_URL environment variable. After installing, run it to create the required database tables:

Terminal window
npx @usebetterdev/webhooks-cli migrate
Example output (may vary)
✔ Connected to database
✔ Created table: webhook_events
✔ Created table: webhook_endpoints
✔ Created table: webhook_deliveries
✔ Migrations complete
Peer dependency reference
AdapterPeer dependencyMinimum version
@usebetterdev/webhooks/drizzledrizzle-orm0.30+
@usebetterdev/webhooks/drizzlepg or postgres or better-sqlite3
@usebetterdev/webhooks/prisma@prisma/client5.0.0
@usebetterdev/webhooks/kyselykysely0.27+
@usebetterdev/webhooks/kyselypg
@usebetterdev/webhooks/honohono4.0.0
@usebetterdev/webhooks/expressexpress4.0.0
@usebetterdev/webhooks/nextnext14.0.0