Skip to content

endalk200/better-webhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

377 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

better-webhook

CI npm Core License: MIT

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

Why developers try better-webhook

  • Safer production handlers: typed payloads, schema validation, signature verification
  • Replay/idempotency controls: provider replay keys with configurable duplicate handling (409 by default when enabled)
  • Fits your stack: adapters for Next.js, Express, NestJS, Hono, and more

Start in 60 seconds

Type-safe webhook handlers with the SDK

npm install @better-webhook/github @better-webhook/nextjs
import { 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);

Documentation

For deep details, use the docs source and package-level READMEs. The root README stays intentionally lightweight.

Security behavior notes

  • Incoming requests are signature-verified before verified but unhandled events return the provider's acknowledgement status (204 by default; some providers such as Resend use 200).
  • When core replay protection is enabled, duplicate replay keys return 409 by default.

Local development

pnpm install --frozen-lockfile
pnpm dev
pnpm lint
pnpm check-types
pnpm test
pnpm build

If you only want to work on docs:

pnpm dev:docs

Repository map

Package directory

Monorepo layout

  • apps/docs - docs site source (better-webhook.dev)
  • apps/examples - runnable framework examples
  • packages - SDK providers, adapters, and shared tooling

Contributing and community

License

MIT