Reading variables
Your variables are attached to your environment's Worker when a deployment is published. Code running at the edge reads them from its env, the object Cloudflare Workers pass to every request.
Hono
On the context, as c.env:
Futon
On ctx.runtime.env, when the app is exported with toWinterCgHandler:
A plain Worker
As the second argument of fetch:
Frontends
A static frontend (Vite, a client-rendered Rasengan.js app, a static site) has no code at the edge: its files are served as they are, so it can't read variables at runtime. Values it needs must be in the bundle, which means set at build time; see Vite's environment variables. Only put values there that anyone may see.
Values are strings
Every variable is a string. Parse numbers and booleans yourself: