Build webhook integrations with typed handlers, schema validation, and signature verification.
Most webhook workflows still require hand-rolled payload parsing, provider-specific signature checks, and framework-specific raw body handling. better-webhook gives you SDK packages for safer production handlers.
better-webhook gives you:
- SDK packages for typed events, schema validation, and signature verification
- Framework adapters for common JavaScript and TypeScript runtimes
- Safer production handlers: typed payloads, schema validation, signature verification
- Replay/idempotency controls: provider replay keys with configurable duplicate handling (
409by default when enabled) - Fits your stack: adapters for Next.js, Express, NestJS, Hono, and more
npm install @better-webhook/github @better-webhook/nextjsimport { github } from "@better-webhook/github";
import { push } from "@better-webhook/github/events";
import { toNextJS } from "@better-webhook/nextjs";
const webhook = github().event(push, async (payload) => {
console.log(payload.repository.full_name);
});
export const POST = toNextJS(webhook);- Docs source:
apps/docs - SDK docs:
packages/core/README.md
For deep details, use the docs source and package-level READMEs. The root README stays intentionally lightweight.
- Incoming requests are signature-verified before verified but unhandled events return the provider's acknowledgement status (
204by default; some providers such as Resend use200). - When core replay protection is enabled, duplicate replay keys return
409by default.
pnpm install --frozen-lockfile
pnpm dev
pnpm lint
pnpm check-types
pnpm test
pnpm buildIf you only want to work on docs:
pnpm dev:docs- Core SDK:
@better-webhook/core - Providers:
@better-webhook/github,@better-webhook/stripe,@better-webhook/ragie,@better-webhook/recall,@better-webhook/resend - Adapters:
@better-webhook/nextjs,@better-webhook/express,@better-webhook/nestjs,@better-webhook/hono,@better-webhook/gcp-functions
apps/docs- docs site source (better-webhook.dev)apps/examples- runnable framework examplespackages- SDK providers, adapters, and shared tooling
- Contributing guide:
CONTRIBUTING.md - Code of conduct:
CODE_OF_CONDUCT.md - Support:
SUPPORT.md - Security policy:
SECURITY.md - Issues: github.com/endalk200/better-webhook/issues
MIT