---
title: "Runtime Adapters"
description: "Runtime adapters allow you to run and deploy your Hono applications seamlessly across different JavaScript runtimes and serverless platforms like Cloudflare Workers, Node.js, Bun, Deno, AWS Lambda,..."
last_updated: "2026-10-12T08:15:16.327396+00:00"
canonical_url: "https://www.doc0.dev/docs/552ca36e-f67e-41c3-a07a-def9bd9551b0/guide/configuration/runtime-adapters"
---

## Overview

Runtime adapters allow you to run and deploy your Hono applications seamlessly across different JavaScript runtimes and serverless platforms like Cloudflare Workers, Node.js, Bun, Deno, AWS Lambda, Vercel, and Netlify. Because Hono is built on standard Web APIs (`Request` and `Response`), adapters bridge platform-specific request and response formats to Hono's unified application handler.

```mermaid
flowchart TD
    A[Incoming HTTP Request] --> B{Runtime / Platform}
    B -->|Cloudflare Workers| C[hono/cloudflare-workers]
    B -->|Cloudflare Pages| D[hono/cloudflare-pages]
    B -->|AWS Lambda| E[hono/aws-lambda]
    B -->|Lambda@Edge| F[hono/lambda-edge]
    B -->|Vercel / Netlify / Deno / Bun| G[Runtime-specific Handlers]
    C --> H[Hono App]
    D --> H
    E --> H
    F --> H
    G --> H
```

---

## Supported Adapters and Imports

Hono provides dedicated entry points for each supported runtime environment. Below is the complete list of available adapter modules and their primary exports.

| Runtime / Platform | Import Path | Key Exports |
| :--- | :--- | :--- |
| Cloudflare Workers | `hono/cloudflare-workers` | `serveStatic`, `upgradeWebSocket`, `getConnInfo` |
| Cloudflare Pages | `hono/cloudflare-pages` | `handle`, `handleMiddleware`, `serveStatic`, `getConnInfo`, `EventContext` |
| Deno | `hono/deno` | `serveStatic`, `toSSG`, `denoFileSystemModule`, `upgradeWebSocket`, `getConnInfo` |
| Bun | `hono/bun` | `serveStatic`, `bunFileSystemModule`, `toSSG`, `createBunWebSocket`, `upgradeWebSocket`, `websocket`, `getConnInfo`, `getBunServer` |
| AWS Lambda | `hono/aws-lambda` | `handle`, `streamHandle`, `defaultIsContentTypeBinary`, `getConnInfo`, `APIGatewayProxyResult`, `LambdaEvent` |
| Vercel | `hono/vercel` | `handle`, `getConnInfo` |
| Netlify | `hono/netlify` | `handle`, `getConnInfo` |
| Lambda@Edge | `hono/lambda-edge` | `handle`, `getConnInfo` |
| Service Worker | `hono/service-worker` | `handle`, `fire` |

> [!NOTE]
> Sources: `package.json`, `jsr.json`, and individual adapter entry files under `src/adapter/`.

---

## Configuration by Platform

### Cloudflare Workers

Cloudflare Workers natively execute code using standard `fetch` event listeners or ES module exports. A Hono app designed for Cloudflare Workers exports the app instance directly.

```ts
import { Hono } from 'hono'

const app = new Hono()

app.get('/', (c) => c.text('Hello from Cloudflare Workers'))

export default app
```

### Cloudflare Pages

For Cloudflare Pages Functions, use the `handle` adapter to wrap your Hono application for the Pages environment.

```ts
import { Hono } from 'hono'
import { handle } from 'hono/cloudflare-pages'

const app = new Hono()

app.get('/', (c) => c.text('Hello from Cloudflare Pages'))

export const onRequest = handle(app)
```

### AWS Lambda

To deploy on AWS Lambda (supporting API Gateway v1/v2, Application Load Balancer, or Function URLs), use the `handle` function from `hono/aws-lambda`.

```ts
import { Hono } from 'hono'
import { handle } from 'hono/aws-lambda'

const app = new Hono()

app.get('/', (c) => c.text('Hello from AWS Lambda'))

export const handler = handle(app)
```

> [!TIP]
> For streaming responses on AWS Lambda, you can use `streamHandle(app)` instead of standard `handle(app)`.

### Vercel

Vercel Serverless Functions expect a handler that accepts a standard `Request` object and returns a `Response`.

```ts
import { Hono } from 'hono'
import { handle } from 'hono/vercel'

const app = new Hono()

app.get('/', (c) => c.text('Hello from Vercel'))

export default handle(app)
```

### Netlify

Netlify functions receive a standard `Request` object and a context object. The Netlify adapter forwards these to Hono automatically.

```ts
import { Hono } from 'hono'
import { handle } from 'hono/netlify'

const app = new Hono()

app.get('/', (c) => c.text('Hello from Netlify'))

export default handle(app)
```

---

## Environment and Connection Helpers

### Detecting Runtimes and Reading Environment Variables

Hono provides a universal `env` helper and runtime detection utility via `hono/adapter`. This allows you to write environment-agnostic code or gracefully read bindings across different platforms.

```ts
import { Hono } from 'hono'
import { env, getRuntimeKey } from 'hono/adapter'

const app = new Hono()

app.get('/', (c) => {
  const runtime = getRuntimeKey()
  return c.text(`Running on: ${runtime}`)
})

app.get('/env', (c) => {
  const bindings = env<{ MY_VAR: string }>(c)
  return c.text(`MY_VAR is ${bindings.MY_VAR}`)
})

export default app
```

Supported runtime keys returned by `getRuntimeKey()` include:
- `node`
- `deno`
- `bun`
- `workerd`
- `fastly`
- `edge-light`
- `other`

> [!IMPORTANT]
> Sources: `src/helper/adapter/index.ts`.

### Retrieving Connection Info

Several runtime adapters export a `getConnInfo` helper to retrieve client connection details such as remote IP addresses.

```ts
import { Hono } from 'hono'
import { handle, getConnInfo } from 'hono/cloudflare-pages'

const app = new Hono()

app.get('/ip', (c) => {
  const info = getConnInfo(c)
  return c.text(`Your IP address is: ${info.remote.address}`)
})

export const onRequest = handle(app)
```

## Related

- [Installation and Setup](https://www.doc0.dev/docs/552ca36e-f67e-41c3-a07a-def9bd9551b0/guide/getting-started/installation-and-setup)
- [App Presets Configuration](https://www.doc0.dev/docs/552ca36e-f67e-41c3-a07a-def9bd9551b0/guide/configuration/app-presets-configuration)


## Sitemap

See the full [sitemap](https://www.doc0.dev/docs/552ca36e-f67e-41c3-a07a-def9bd9551b0/llms.txt) for all pages in this wiki.
