Hono env access

How can I access env variables in other files ? Like we do it express process.env.VAR but in hono we do it in the request c.env.VAR. But I want to access the env in other file. How can I do this ?
3 Replies
Niveth
Niveth4d ago
you will have to pass around the .evn to all functions that requires it.
iamjoey.sol
iamjoey.solOP4d ago
Yeah this is what I was doing all this time, just wanted to know is there any other way
Walshy
Walshy3d ago
AsyncLocalStorage is your friend I always setup a store in middleware passing in env, drizzle instance, sentry, etc

Did you find this page helpful?