Skip to main content
Faremeter API
Faremeter API / middleware/src / hono

hono

Functions

createMiddleware()

createMiddleware(args): Promise<MiddlewareHandler>
Defined in: packages/middleware/src/hono.ts:27 Creates Hono middleware that gates routes behind x402 payment. The middleware intercepts requests, checks for payment headers, communicates with the facilitator to validate and settle payments, and only allows the request to proceed if payment is successful.

Parameters

args
CreateMiddlewareArgs Configuration including facilitator URL and accepted payment types

Returns

Promise<MiddlewareHandler> A Hono middleware handler