env variables are empty - Hono
Hello can you help me with some small example how to work locally with env variables?
I tried c.env.API_KEY
i tried env(c)
i tried env(c, "workerd")
each combo with .dev.vars and wrangler.toml vars
Every time when wranger dev it says
(wrangler.toml)
Your worker has access to the following bindings:
(.dev.vars)
Using vars defined in .dev.vars
Your worker has access to the following bindings:
Any tips? checked github and hono docs. Seems like I am missing something really trivial. How are you using hono locally with env vars? Seems weird that it says Your worker has access to the following bindings but there is nothing :/
I tried c.env.API_KEY
i tried env(c)
i tried env(c, "workerd")
each combo with .dev.vars and wrangler.toml vars
Every time when wranger dev it says
(wrangler.toml)
Your worker has access to the following bindings:
- Vars:
- COOKIE_SECRET: "secret"
- AUTH_URL: "https://auth-dev.service.com/"
(.dev.vars)
Using vars defined in .dev.vars
Your worker has access to the following bindings:
- Vars:
- COOKIE_SECRET: "(hidden)"
- AUTH_URL: "(hidden)"
Any tips? checked github and hono docs. Seems like I am missing something really trivial. How are you using hono locally with env vars? Seems weird that it says Your worker has access to the following bindings but there is nothing :/



