I tend to use env variables instead of env files (12 Factor Apps - https://12factor.net/). Safer, not safest. As @late_night_fix mentioned, there has to be a balance.
The main point of hypermedia is the browser, not a gaming platform. Not even the mobile platform. HTMX is not purposed nor it advertises that it should be used outside of the browser scope.
I use Unpoly that replies on the same principles (HTML over the wire) and both of them are very clear about their intentions.