2

My question is how to display the google map without exposing the api-key in the front end. For retrieving simple JSON response from google i can store the api-key on my server and then using fetch in my react Frontend retrieve data from google over my server. e.g.:

react front <-> myServer [gmap api key] <-> google

fetch/axios('requestToMyServer').then(display Response)

However cant figure out so simple how to dsiplay the actual map.

Storing the API-Key in the .env as a variable is not a solution, if I can simply console.log(varName) from the client and abuse the key.

All kinds of hints, suggestions and solutions are welcome.

Thank you all in advance <3

igor.live
  • 45
  • 7

0 Answers0