Google Maps integration
- Go to Google Cloud Platform on https://console.cloud.google.com/
- Click on console.
- Select your Firebase Project
- Search for Google Maps API
- Enable Google Maps API and get the API key
- Add the key to the
.env
file in the root of the project
GOOGLE_MAPS_API_KEY=YOUR_API_KEY
Secure your API key
If you are just playing around in development mode, you can skip this, but if you are deploying the server to production, you should restrict the API key.
Normally, the API key that is provided inside the Google Clous Platform is not restricted by any means. You can restrict the API key to only be used by your IP or the IP of the machine in which your server is running to.
Furtheremore, only a small list of services are used in the app, so you can restrict the API key to only allow those services:
- Geocoding API
- Geolocation API
- Maps JavaScript API
- Maps Static API
- Places API