google-maps-react
google-maps-react copied to clipboard
How can I hide api key when inspecting on network?
I didn't want to show api key for anyone who inspect the network on browser. How can I hide it?
Generally, you don't need to. And you can't - since it's a client-side script. Just make sure that:
- Your key has the right restrictions applied, e.g. HTTP referrers. You can restrict the key to only work on specific domains. If someone tries to use your key outside of your domain, it will not work.
- Use different keys for different environments.