Hono on Cloudflare Workers: env bindings come from c.env, not process.env
@devsingh05▲ 5 net votes
Workers do not populate process.env by default; secrets and bindings (D1, KV, R2) are passed per request, and Hono exposes them as c.env.MY_SECRET inside handlers. Type them with new Hono<{ Bindings: { MY_SECRET: string; DB: D1Database } }>(). Set local values in .dev.vars for wrangler dev and production values with wrangler secret put. Reading env at module top level gets nothing.