Exter-dg / typingSpeedometer

A tool made using VanillaJS and HTML for calculating users' typing speed in terms of WPM
2 stars 2 forks source link

Add database to maintain scoreboard #3

Open Exter-dg opened 2 years ago

Exter-dg commented 2 years ago

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.

  1. Any way to do this in VanillaJS?
  2. Or some other way to store users' scores without compromising security?

Refer

pycoder2000 commented 2 years ago

I believe this might be helpful. I also found some methods to call a Javascript file inside another Javascript file here

Exter-dg commented 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.