Overview
Kotodayori is a Hono-inspired, type-safe webhook routing library for TypeScript. Originally built for Stripe webhooks, it has evolved into a framework-agnostic webhook handling solution that works with any event source.
Key characteristics
Section titled “Key characteristics”- Type-safe webhook routing — Full TypeScript support with generic event type definitions
- Framework-agnostic core — Core routing logic has zero framework dependencies
- First-class Stripe support — 351+ Stripe event types with full type inference
- Monorepo structure — Multiple packages for core, adapters, and tooling
- Node.js >= 18 — Modern runtime support
Architecture
Section titled “Architecture”Kotodayori follows an adapter pattern: the core package (@kotodayori/core) contains all routing logic and has no framework dependencies. Framework-specific packages (Hono, Express, Lambda, EventBridge) wrap the core and expose it for their environment.
flowchart LR Core["@kotodayori/core"] Stripe["@kotodayori/stripe"] Hono["@kotodayori/hono"] Express["@kotodayori/express"] Lambda["@kotodayori/lambda"] EB["@kotodayori/eventbridge"]
Stripe --> Core Hono --> Core Express --> Core Lambda --> Core EB --> CoreDesign principles
Section titled “Design principles”- Type safety first — All events are fully typed using generics
- Framework-agnostic core — Core has zero framework dependencies
- Adapter pattern — Framework integrations wrap the core
- Chainable API — Hono-inspired fluent interface for registering handlers
- Pluggable verification — Bring your own verifier for any webhook provider
- Runtime validation — Optional Zod integration for schema validation
Next steps
Section titled “Next steps”- Installation — Install Kotodayori and choose your adapter
- Stripe Webhooks — Set up Stripe webhooks with type safety
- Custom Webhooks — Use Kotodayori with any webhook provider