Home > Software engineering >  How do I use my api keys in vercel deployment but hide it from github?
How do I use my api keys in vercel deployment but hide it from github?

Time:01-21

The deployed app is not able to fetch the api data as the vercel has used my git-hub repo, where the api-keys are hidden.

I have created in React project, which is there on github. To avoid leaking of my API keys i have stored them in .env file and added .env file in .gitignore.

So while running the app on localhost its working fine its able to fetch data from the apis, But I had deployed the app on vercel. Which used my git-hub repo to deploy it, which doesn't contains my apis hence not able to fetch data.

How can I deploy the app on vercel and still use the apis?

CodePudding user response:

You need to recreate the .env file (fill the environment data) on your vercel, check the official documentation on this topic

  • Related