Skip to content

Kotodayori

A Hono-inspired, type-safe webhook routing library for TypeScript

Kotodayori provides a clean, type-safe API for handling webhooks from any event source. It features a modular architecture with adapters for popular frameworks and platforms, and a pluggable verifier system for signature validation.

  • Type-Safe — Full TypeScript support with generic event type definitions
  • Framework Adapters — Built-in support for Hono, Express, AWS Lambda, and EventBridge
  • Pluggable Verification — Bring your own verifier for any webhook provider
  • Middleware Support — Add cross-cutting concerns with middleware
  • Flexible Routing — Group handlers, mount nested routers, and fanout patterns
  • Stripe Support — First-class support for 351+ Stripe event types

The fastest way to get started is using the scaffolding tool:

Terminal window
npx create-kotodayori

Or install and use with Stripe and Hono:

Terminal window
pnpm add @kotodayori/stripe @kotodayori/hono stripe
import { Hono } from 'hono';
import Stripe from 'stripe';
import { StripeWebhookRouter, createStripeVerifier } from '@kotodayori/stripe';
import { honoAdapter } from '@kotodayori/hono';
const stripe = new Stripe(process.env.STRIPE_API_KEY!);
const router = new StripeWebhookRouter();
router.on('payment_intent.succeeded', async (event) => {
console.log('Payment succeeded:', event.data.object.id);
});
const app = new Hono();
app.post('/webhook', honoAdapter(router, {
verifier: createStripeVerifier(stripe, process.env.STRIPE_WEBHOOK_SECRET!),
}));
export default app;
PackageDescription
@kotodayori/coreCore webhook routing logic and Verifier type
@kotodayori/stripeStripe-specific types, router, and verifier
@kotodayori/zodZod schema validation helpers
@kotodayori/honoHono framework adapter
@kotodayori/expressExpress framework adapter
@kotodayori/lambdaAWS Lambda adapter
@kotodayori/eventbridgeAWS EventBridge adapter
create-kotodayoriScaffolding tool for new projects