Binbasri-in / binbasri_cli

My personal website in Command Line Interface
MIT License
0 stars 0 forks source link

Security Issue: Move your gemini api key to server side environment variable #5

Open strawtube opened 2 days ago

strawtube commented 2 days ago

I noticed that your current q&a functionality directly includes your gemini api key in frontend js code. To keep your api key safe you could maybe do the following:

  1. Remove the hardcoded api key from frontend. Store it as environment variable in whatever hosting platform you are using.
  2. Create a backend endpoint for request to the gemini api (frontend can interact with backend without exposing key).
  3. Update frontend js code to fetch data through backend endpoint (thus no direct calls to gemini api).
Binbasri-in commented 2 days ago