How do I access environment variables or config from the front end?

What about

var currentHost = window.location.host;