Accessing a config var from browser JavaScript (not Node) in Heroku

I would like to get info from GitHub API from browser JS on my website … Read more Accessing a config var from browser JavaScript (not Node) in Heroku

I would like to get info from GitHub API from browser JS on my website hosted on Heroku.

I have thought of two ways to do this:

  1. Hide an API key in a config var and read the config var in JS

    I went with this option and I ran into an issue:

    To hide the API key I would need to make a config var in the settings of my project, then read it using browser (not Node) JavaScript. I currently am stuck on reading the config var using JS.

  2. Through a GitHub workflow run on push (or whatever event)

    This is an advantage because I can read the repo from inside a workflow and not need to use a key (I think). Then the workflow would write data to a file on the website.

Source: JavaSript – Stack Overflow



Leave a Reply

Your email address will not be published. Required fields are marked *