Open Exter-dg opened 2 years ago
I believe this might be helpful. I also found some methods to call a Javascript file inside another Javascript file here
@pycoder2000 This only hides the keys in a separate file which is not pushed on GitHub. This site is hosted on GitHub pages and we would require those keys in config.js
to use the database. The way proposed in the like can only hide those keys from the public. We want a way to hide them while allowing GitHub pages to access those keys for querying the database.
I thought of using Firebase's Cloud Firestore as a database to store users' scores. It works. But I am not able to find a way to hide firebase's API keys from the public. If it was Node, we could have used Github Secrets to create env variables (refer) and use them.
Refer