You cannot get ENV variables in a browser. You can send a request for the recreation service to your server and get env on the backend, and then return to the client
Quick example: (Express.js)
app.get("/rest/getenv", function(req, res) { var env = process.env.ENV_VARIABLE; res.json({result: env}); });
Edit:
You need to protect this remainder url along with the token as strings. Or anyone can reach this URL and get the value of an environment variable. This could be a security issue.
source share