/Knowledge/sources/honojs__hono/llms-full/cloudflare-workers-bindings--aaa762002df4.md
Cloudflare Workers: Bindings - hono-docs
Cloudflare Workers: Bindings Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt bindings Summary In the C...
Cloudflare Workers: Bindings
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#bindings
Summary
In the Cloudflare Workers, we can bind the environment values, KV namespace, R2 bucket, or Durable Object. You can access them in c.env. It will have the types if you pass the "type definition" for the bindings to the Hono as gener...
Content
In the Cloudflare Workers, we can bind the environment values, KV namespace, R2 bucket, or Durable Object. You can access them in c.env. It will have the types if you pass the "type definition" for the bindings to the Hono as generics.
type Bindings = {
MY_BUCKET: R2Bucket
USERNAME: string
PASSWORD: string
}
const app = new Hono<{ Bindings: Bindings }>()
// Access to environment values
app.put('/upload/:key', async (c, next) => {
const key = c.req.param('key')
await c.env.MY_BUCKET.put(key, c.req.body)
return c.text(`Put ${key} successfully!`)
})
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#bindings",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / Cloudflare Workers > Bindings",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 388,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "Cloudflare Workers: Bindings",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}