How to access state globally?

I am looking for help on how to access process.env to gain access to an environment variable value set up in .env, on the client side. I know that Frontity, for some reason, fills up the state with those values and leaves the process.env empty, but this means that environment values can only be accessed in components and then passed down. I need to access those variables globally, ie. outside of a component. I don’t like to pass down values through four functions, when I should be able to just pass process.env.API_URL to a constructor.

How can I go about this?

A hack I’ve made is basically having a component add an __env property to window after I’ve accessed state .At least this way I can access those variables globally.