/Knowledge/sources/honojs__hono/llms-full/context-env--3df96d2d495c.md
Context: env - hono-docs
Context: env Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt env Summary In Cloudflare Workers Environ...
Context: env
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#env
Summary
In Cloudflare Workers Environment variables, secrets, KV namespaces, D1 database, R2 bucket etc. that are bound to a worker are known as bindings. Regardless of type, bindings are always available as global variables and can be accessed...
Content
In Cloudflare Workers Environment variables, secrets, KV namespaces, D1 database, R2 bucket etc. that are bound to a worker are known as bindings.
Regardless of type, bindings are always available as global variables and can be accessed via the context c.env.BINDING_KEY.
import { Hono } from 'hono'
type KVNamespace = any
// ---cut---
// Type definition to make type inference
type Bindings = {
MY_KV: KVNamespace
}
const app = new Hono<{ Bindings: Bindings }>()
// Environment object for Cloudflare Workers
app.get('/', async (c) => {
c.env.MY_KV.get('my-key')
// ...
})
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#env",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / Context > env",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 566,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "Context: env",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}