skip to Main Content

i have doing small project using html, JS with API keys in it.

At then , uploaded in GitHub with the code as it as , then GitGuardian throws an warning that i shared my API in public repo

can anyone suggest , how can i upload API keys directly into GitHub , so that i host in some websites

Some ways to tokenize or change my API key to upload directly to GitHub

2

Answers


  1. Github secrets is what you are looking for.

    Login or Signup to reply.
  2. You can use enivronment variables to save your api keys and other credentials. And if your uploading your code to git, you can use .gitignore to hide the environment variables file.

    Reference links:

    Environment variables : https://nodejs.org/en/learn/command-line/how-to-read-environment-variables-from-nodejs

    gitignore : https://git-scm.com/docs/gitignore

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search