Quantcast
Viewing all articles
Browse latest Browse all 12261

How to hide PAT in js file to host it at github Pages

I have a simple html page that connects with a js file and makes api calls to gihub api, Although it works very well in my local environment as soon as I push the repository to github my PAT(personal Authentication Token) on github expires as it is now exposed to public. And my html webpage goes down as now it is not authenticated make calls to api. How can I solve this issue I want to host my html and js file online, but there is no way I can hide the PAT as its only javascript and not nodejs so there is no dotenv. Is there any way??

I tried to change the API key to PAT as chat gpt suggested this but it expires as soon as I push to the github.


Viewing all articles
Browse latest Browse all 12261

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>