I have a ruby/rack app on Heroku serving a site. The site uses Javascript and I want to access an Heroku environment variable in the Javascript file (an API key). I've tried:
process.env.API_KEY
// As well as:
process.env['API_KEY']
But neither seem to work. I get a process is not defined error. The above lines of code I got were from a Node.js app running on Heroku. I thought it'd be the same way to access the keys from a normal js file but it doesn't work.