google-maps-react icon indicating copy to clipboard operation
google-maps-react copied to clipboard

How can I hide api key when inspecting on network?

Open minhokokocrunch opened this issue 4 years ago • 1 comments

I didn't want to show api key for anyone who inspect the network on browser. How can I hide it?

minhokokocrunch avatar Sep 15 '21 10:09 minhokokocrunch

Generally, you don't need to. And you can't - since it's a client-side script. Just make sure that:

  1. 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.
  2. Use different keys for different environments.

eegli avatar Sep 29 '21 08:09 eegli