As you can see in the picture the API key is not protected and what is the solution?
Asked
Active
Viewed 1,134 times
0
-
One way is to do that I'm not sure it helps you but if you minify your js with webpack plugin then it might be easy better to secure your api. – Shubham Apr 20 '18 at 04:05
-
1You need to make a request with your server side language and use the api key on server instead of client. 1st you will need a route to make a request with axios /fetch/products/id and on that route you will make another request(the one from the picture) but with server side . Otherwise you can't really secure it – Munteanu Petrisor Apr 20 '18 at 05:57
-
1use the .env file on your project. Take a look to this link: https://stackoverflow.com/questions/48699820/how-do-i-hide-api-key-in-create-react-app – TDev Jan 13 '21 at 06:55