> ## Documentation Index
> Fetch the complete documentation index at: https://docs.faremeter.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Hono Middleware

> x402 payment middleware for Hono web framework

# hono

## Functions

### createMiddleware()

> **createMiddleware**(`args`): `Promise`\<`MiddlewareHandler`>

Defined in: [packages/middleware/src/hono.ts:32](https://github.com/faremeter/faremeter/blob/main/packages/middleware/src/hono.ts#L32)

Creates Hono middleware that gates routes behind x402 and MPP payment.

The middleware intercepts requests, checks for payment headers, validates
and settles payments via x402 or MPP protocol, and only allows the
request to proceed if payment is successful.

#### Parameters

##### args

`CreateMiddlewareArgs`

Configuration including handlers + pricing or facilitator URL

#### Returns

`Promise`\<`MiddlewareHandler`>

A Hono middleware handler


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.