Add Forge

Mount the middleware before paymentMiddleware from @x402/hono:
Everything from the Express integration applies: the 402 gets the rating ask and the forge-feedback extension, paid JSON responses get the feedback fields, the payment receipt gets the extension, agent context is read and removed before your handlers, and your /openapi.json is served enriched.

Runtimes

Serve with @hono/node-server, as in the example below.

Without Hono

Any (request) => Response handler works with the fetch adapter:
forge.handle(request, next) does the same for a single request, and forge.route(request) answers only Forge’s own routes.

Complete example

A text-statistics API on Base Sepolia. Forge lines are marked (forge). From examples/hono in the Forge SDK repository.
server.ts
Run it: