---
name: hono-docs
description: "Use when working with Hono: build or scaffold a hono application and choose a runtime or deployment target; define routes, path parameters, and http methods, or access request data through honorequest and context; add middleware for authentication, cors, csrf, logging, compression, caching, or security headers. Answers from the Hono docs (hono.dev), kept in sync."
---

# Hono docs

Hono is a small web framework built on Web Standards, with quick start commands and support for many runtimes and deployment targets. Its documentation covers the API (the Hono object, routing, Context, HonoRequest, HTTPException, presets), concepts like middleware, routers, benchmarks, developer experience and Web Standards, and getting-started guides for platforms such as Cloudflare Workers, Deno, Bun, Node.js, AWS Lambda, Vercel, and Netlify. It also documents helpers, built-in and third-party middleware, and guides for testing, validation, JSX, RPC, and migrating to v5.

## When to use this skill

- Build or scaffold a Hono application and choose a runtime or deployment target
- Define routes, path parameters, and HTTP methods, or access request data through HonoRequest and Context
- Add middleware for authentication, CORS, CSRF, logging, compression, caching, or security headers
- Write type-safe APIs and clients with Hono RPC, Zod validation, and the testing helpers
- Render HTML or interactive UI using the JSX and JSX DOM guides
- Debug or benchmark a Hono app using the Hono CLI, Dev helper, or route and timing helpers

## Key concepts

- **Web Standards**: Hono is built on Web Standards APIs and supports multiple runtimes, which is the basis of its design philosophy.
- **Routing**: Hono defines routes by HTTP method, path, wildcards, and path parameters, and the preset (hono, quick, tiny) selects the router used.
- **Context and HonoRequest**: The Context object accesses the request, sets response status and headers, and stores request values, while HonoRequest reads path parameters and query strings.
- **Middleware**: Middleware wraps handlers to process requests and responses, and Hono ships built-in middleware such as basic/bearer/JWT auth, CORS, CSRF, logger, cache, compress, and secure-headers, plus third-party packages.
- **Helpers**: Helper functions such as cookie, JWT, streaming, SSG, WebSocket, factory, and testing support application development without acting as middleware handlers.
- **RPC and type safety**: Hono Stacks and the RPC guide share API specifications between server and client so the Hono Client infers input and output types, complementing Hono's TypeScript developer experience.
- **Deployment targets**: Getting-started guides cover platforms including Cloudflare Workers, Deno, Bun, Node.js, AWS Lambda, Lambda@Edge, Vercel, Netlify, Fastly Compute, Google Cloud Run, Azure Functions, Supabase Edge Functions, and others.
- **JSX**: Hono provides hono/jsx for server and client rendering and hono/jsx/dom client components with a small React-like API, along with a JSX renderer middleware and css and html helpers.

## How to look things up

1. Prefer the live docs over memory: Hono changes, and these pages are re-synced from https://hono.dev/docs.
2. If the `hono-dev-docs` MCP server is connected, call `search_docs` with the question, then `get_page` on the best URL for the full text.
3. Otherwise read `reference/index.md` in this folder to find the page, then open its section file in `reference/` or fetch the URL.
4. The whole docs as one file: https://skilldock.vibiz.app/d/hono-dev-docs/llms-full.txt

## Reference

### Overview

- [Hono - Web framework built on Web Standards](https://hono.dev/docs): Introduces Hono as a small web framework and shows quick start commands.

### Middleware

- [Basic Auth Middleware](https://hono.dev/docs/middleware/builtin/basic-auth): Apply Basic authentication to specified Hono paths using username and password credentials.
- [Bearer Auth Middleware](https://hono.dev/docs/middleware/builtin/bearer-auth): Protect Hono routes by verifying Bearer tokens in the Authorization request header.
- [Body Limit Middleware](https://hono.dev/docs/middleware/builtin/body-limit): Limit request body file size and handle oversized uploads with a custom error response.
- [Cache Middleware](https://hono.dev/docs/middleware/builtin/cache): Add Cache API middleware to cache responses on Cloudflare Workers custom domains and Deno.
- [Combine Middleware](https://hono.dev/docs/middleware/builtin/combine): Combine multiple Hono middleware functions with some, every, and except helpers.
- [Compress Middleware](https://hono.dev/docs/middleware/builtin/compress): Compress Hono response bodies with gzip or deflate based on Accept-Encoding headers.
- [Context Storage Middleware](https://hono.dev/docs/middleware/builtin/context-storage): Store Hono Context in AsyncLocalStorage and retrieve it globally with getContext.
- [CORS Middleware](https://hono.dev/docs/middleware/builtin/cors): Configure CORS headers for Hono routes to allow cross-origin requests from front-end applications.
- [CSRF Protection](https://hono.dev/docs/middleware/builtin/csrf): Protect Hono routes from CSRF attacks by validating Origin and Sec-Fetch-Site headers.
- [ETag Middleware](https://hono.dev/docs/middleware/builtin/etag): Add ETag headers to Hono responses and configure retained headers for 304 responses.
- [IP Restriction Middleware](https://hono.dev/docs/middleware/builtin/ip-restriction): Restrict Hono route access using IP allow lists and deny lists with getConnInfo.
- [JSX Renderer Middleware](https://hono.dev/docs/middleware/builtin/jsx-renderer): Set up JSX layouts for c.render and access Context inside components with useRequestContext.
- [JWK Auth Middleware](https://hono.dev/docs/middleware/builtin/jwk): Authenticate requests by verifying JWT tokens against JSON Web Key sets and configured algorithms.
- [JWT Auth Middleware](https://hono.dev/docs/middleware/builtin/jwt): Add JWT authentication middleware that verifies tokens from Authorization headers or cookies.
- [Language Middleware](https://hono.dev/docs/middleware/builtin/language): Use the language detector middleware to determine a user's preferred language from query, cookie, header, or path for i18n.
- …and 11 more in reference/index.md

### Getting Started

- [Alibaba Cloud Function Compute](https://hono.dev/docs/getting-started/ali-function-compute): Shows running Hono on Alibaba Cloud Function Compute with a third-party adapter.
- [AWS Lambda](https://hono.dev/docs/getting-started/aws-lambda): Explains deploying Hono to AWS Lambda using CDK and the AWS Lambda adapter.
- [Azure Functions](https://hono.dev/docs/getting-started/azure-functions): Guides deploying Hono on Azure Functions using the Azure Functions adapter.
- [Getting Started](https://hono.dev/docs/getting-started/basic): Walks through creating, developing, and deploying a Hono project from templates.
- [Bun](https://hono.dev/docs/getting-started/bun): Explains setting up and running a Hono project on the Bun runtime.
- [Tencent CloudBase](https://hono.dev/docs/getting-started/cloudbase): Guides running Hono on Tencent CloudBase HTTP Cloud Functions with Node.js.
- [Cloudflare Pages](https://hono.dev/docs/getting-started/cloudflare-pages): Set up Hono on Cloudflare Pages and review deprecation warning recommending Workers instead.
- [Cloudflare Workers](https://hono.dev/docs/getting-started/cloudflare-workers): Build and deploy a Hono application on Cloudflare Workers with Wrangler and TypeScript.
- [Cloudflare Workers + Vite](https://hono.dev/docs/getting-started/cloudflare-workers-vite): Shows creating a full-stack Hono app on Cloudflare Workers with Vite.
- [Deno](https://hono.dev/docs/getting-started/deno): Run and deploy a Hono application on Deno with a TypeScript setup.
- [Fastly Compute](https://hono.dev/docs/getting-started/fastly): Create and deploy a Hono application on Fastly Compute using the Fastly CLI.
- [Google Cloud Run](https://hono.dev/docs/getting-started/google-cloud-run): Guides deploying Hono on Google Cloud Run using containers and gcloud CLI.
- [Lambda@Edge](https://hono.dev/docs/getting-started/lambda-edge): Shows deploying Hono to Lambda@Edge using CDK and the adapter.
- [Netlify](https://hono.dev/docs/getting-started/netlify): Create a Hono application for Netlify Edge Functions and deploy using Netlify CLI.
- [Next.js](https://hono.dev/docs/getting-started/nextjs): Run Hono on Next.js using the Node.js runtime and deploy with Vercel Functions.
- …and 5 more in reference/index.md

### Helpers

- [Accepts Helper](https://hono.dev/docs/helpers/accepts): Handle Accept headers in requests by using the accepts helper to negotiate content, language, or encoding.
- [Adapter Helper](https://hono.dev/docs/helpers/adapter): Use the Adapter helper to retrieve environment variables and runtime keys across different serverless platforms.
- [ConnInfo Helper](https://hono.dev/docs/helpers/conninfo): Retrieve client connection information such as remote address using the ConnInfo helper and runtime adapters.
- [Cookie Helper](https://hono.dev/docs/helpers/cookie): Manage regular and signed cookies by setting, getting, and deleting them with the Cookie helper.
- [css Helper](https://hono.dev/docs/helpers/css): Write CSS in JSX template literals and get class names with a Style component.
- [Dev Helper](https://hono.dev/docs/helpers/dev): Get the active router name and print registered routes to the console during development.
- [Factory Helper](https://hono.dev/docs/helpers/factory): Create typed Hono apps, middleware, and handlers using factory functions with environment generics.
- [html Helper](https://hono.dev/docs/helpers/html): Write HTML in tagged template literals and render unescaped strings using raw().
- [JWT Authentication Helper](https://hono.dev/docs/helpers/jwt): Encode, decode, sign, and verify JSON Web Tokens using the JWT helper functions.
- [Proxy Helper](https://hono.dev/docs/helpers/proxy): Forward requests through a Hono app as a reverse proxy using a fetch wrapper.
- [Route Helper](https://hono.dev/docs/helpers/route): Access matched routes, route path, and base path information inside handlers for debugging.
- [SSG Helper](https://hono.dev/docs/helpers/ssg): Generate static files from your Hono application routes by running a build script.
- [Streaming Helper](https://hono.dev/docs/helpers/streaming): Stream responses from Hono using stream, streamText, and streamSSE helper functions.
- [Testing Helper](https://hono.dev/docs/helpers/testing): Test Hono applications with testClient, which returns a type-safe client for defined routes.
- [WebSocket Helper](https://hono.dev/docs/helpers/websocket): Use upgradeWebSocket adapters for Cloudflare Workers, Deno, Bun, and Node.js server-side WebSockets.

### Guides

- [Best Practices](https://hono.dev/docs/guides/best-practices): Follow Hono best practices by writing route handlers directly instead of Ruby on Rails-like controllers for better type inference.
- [Create-hono](https://hono.dev/docs/guides/create-hono): Use create-hono command-line flags to select templates, skip prompts, and customize project initialization.
- [Examples](https://hono.dev/docs/guides/examples): Find example Hono applications and code samples in the dedicated examples section.
- [Frequently Asked Questions](https://hono.dev/docs/guides/faq): Get answers to frequently asked Hono questions, including third-party Renovate configuration setup.
- [Helpers](https://hono.dev/docs/guides/helpers): Use helper functions like cookie utilities that assist application development without acting as middleware handlers.
- [JSX](https://hono.dev/docs/guides/jsx): Configure TypeScript or Deno to write HTML using JSX syntax with hono/jsx for server and client rendering.
- [Client Components](https://hono.dev/docs/guides/jsx-dom): Build interactive browser UI with hono/jsx/dom client components using a small React-like API.
- [Middleware](https://hono.dev/docs/guides/middleware): Register middleware to run before or after handlers, awaiting next or returning responses to exit early.
- [Migrating to v5](https://hono.dev/docs/guides/migrating-to-v5): Migrate Hono v4 applications to v5 by updating ESM imports and installing separate runtime adapter packages.
- [Miscellaneous](https://hono.dev/docs/guides/others): Learn ways to contribute to Hono, sponsor authors, and find related repositories and package registries.
- [RPC](https://hono.dev/docs/guides/rpc): Share API specifications between server and client so the Hono Client infers input and output types.
- [Testing](https://hono.dev/docs/guides/testing): Test Hono applications by creating Request objects and validating Response objects with the app.request method.
- [Validation](https://hono.dev/docs/guides/validation): Validate incoming request data with Hono's validator middleware and share API types using RPC.

### API

- [Context](https://hono.dev/docs/api/context): Use the Context object to access requests, set response status and headers, and store request values.
- [HTTPException](https://hono.dev/docs/api/exception): Throw custom HTTP exceptions with status codes, messages, or custom responses for error handling.
- [App - Hono](https://hono.dev/docs/api/hono): Learn the main Hono object and its methods for routing, middleware, errors, and requests.
- [API](https://hono.dev/docs/api/index): Learn Hono's API structure covering the Hono object, routing, Context, and middleware.
- [Presets](https://hono.dev/docs/api/presets): Choose between Hono presets like hono, quick, and tiny to select the appropriate router for your use case.
- [HonoRequest](https://hono.dev/docs/api/request): Explains how to read path parameters and query strings from HonoRequest.
- [Routing](https://hono.dev/docs/api/routing): Covers defining routes, HTTP methods, wildcards, and path parameters in Hono.

### Concepts

- [Benchmarks](https://hono.dev/docs/concepts/benchmarks): Shows benchmark results comparing Hono routers against other JavaScript routers.
- [Developer Experience](https://hono.dev/docs/concepts/developer-experience): Describes Hono's TypeScript developer experience and type-safe application writing.
- [Middleware](https://hono.dev/docs/concepts/middleware): Shows how middleware wraps handlers to process requests and responses in Hono.
- [Philosophy](https://hono.dev/docs/concepts/motivation): Explains Hono's design philosophy, motivation, Web Standards, and ecosystem growth.
- [Routers](https://hono.dev/docs/concepts/routers): Introduces Hono's five routers and when to use RegExpRouter or TrieRouter.
- [Hono Stacks](https://hono.dev/docs/concepts/stacks): Explains building type-safe APIs and clients using Hono RPC and Zod.
- [Web Standards](https://hono.dev/docs/concepts/web-standard): Lists Web Standards APIs Hono uses and the runtimes it supports.

### Agents

- [Hono CLI](https://hono.dev/docs/agents/cli): Install and run the Hono CLI to inspect routes, send requests, benchmark, and generate static sites.
- [Hono for Coding Agents](https://hono.dev/docs/agents/index): Guides coding agents to set up Hono projects and fetch Markdown documentation.

### Index

- [Hono - Web framework built on Web Standards](https://hono.dev/docs/index): Learn what Hono is, its features, runtimes, and quick start for building web apps.

## Install the MCP server

```bash
claude mcp add --transport http hono-dev-docs https://skilldock.vibiz.app/mcp/hono-dev-docs
```

_Generated by Skilldock from https://hono.dev/docs. Unofficial unless claimed by the docs owner: https://skilldock.vibiz.app/d/hono-dev-docs_
