/Wiki/sources/honojs__hono/2026/https-raw-githubusercontent-com-honojs-hono-main-8eb7fa90328d-the-arguments-of-generics-for-new-hono-have-been-changed-s0020-c0000.md
The arguments of Generics for `new Hono` have been changed - hono-docs
The arguments of Generics for new Hono have been changed Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://raw.githubuserc...
The arguments of Generics for new Hono have been changed
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://raw.githubusercontent.com/honojs/hono/main/docs/MIGRATION.md#the-arguments-of-generics-for-new-hono-have-been-changed
Summary
Now, the constructor of "Hono" receives Variables and Bindings. "Bindings" is for types of environment variables for Cloudflare Workers. "Variables" is for types of c.set/c.get ```ts type Bindings = { KV: KVNamespace Storage: R2B...
Content
Now, the constructor of "Hono" receives Variables and Bindings.
"Bindings" is for types of environment variables for Cloudflare Workers. "Variables" is for types of c.set/c.get
type Bindings = {
KV: KVNamespace
Storage: R2Bucket
}
type WebClient = {
user: string
pass: string
}
type Variables = {
client: WebClient
}
const app = new Hono<{ Variables: Variables; Bindings: Bindings }>()
app.get('/foo', (c) => {
const client = c.get('client') // client is WebClient
const kv = c.env.KV // kv is KVNamespace
//...
})