Skip to content

Add Hono adapter for edge runtimes#50

Merged
Prateek32177 merged 2 commits intomainfrom
codex/add-hono-adapter-for-tern-sdk
Mar 4, 2026
Merged

Add Hono adapter for edge runtimes#50
Prateek32177 merged 2 commits intomainfrom
codex/add-hono-adapter-for-tern-sdk

Conversation

@Prateek32177
Copy link
Contributor

Motivation

  • Provide first-class Hono integration so the SDK works natively on Hono-powered edge runtimes while matching existing adapter behavior and surface.
  • Ensure the adapter reads raw request bytes via Hono's c.req.raw, uses Hono Request/Response primitives only, and supports queueing and alerting like other adapters.

Description

  • Add a typed Hono adapter implementing createWebhookHandler at src/adapters/hono.ts that calls WebhookVerificationService.verifyWithPlatformConfig, supports queue, alerts, normalize, toleranceInSeconds, and returns a Hono-compatible handler that receives c and uses c.req.raw.
  • Add an adapter entrypoint src/hono.ts and re-export the Hono API from the adapters barrel in src/adapters/index.ts, and include HonoContextLike/HonoWebhookHandlerOptions types.
  • Update package.json exports and typesVersions to expose ./hono, add discoverability keywords, and update documentation in README.md and USAGE.md with Hono usage examples.
  • Add tests exercising Hono flows in src/test.ts (valid verification path and invalid-signature path) to match the existing adapter test pattern.

Testing

  • Built the project with npm run build and the TypeScript compilation completed successfully.
  • Ran the test suite with npm test and all tests passed, including the new Hono adapter tests.
  • No new dependencies were added.

Codex Task

@Prateek32177 Prateek32177 merged commit 00e01b5 into main Mar 4, 2026
6 checks passed
@Prateek32177 Prateek32177 deleted the codex/add-hono-adapter-for-tern-sdk branch March 4, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant