Maps and addresses
Connect Google Maps to your app
What is Google Maps?
Google Maps Platform lets your app show Google maps and places.
- What it costs
- Google needs a payment card on file, even to start. Each month a set amount of map use is free (10,000 map loads), and new Google Cloud accounts get a free trial credit.
- Time needed
- About 15 minutes. You need a Google account and a payment card.
- If you skip it
- Your app still works. Only the maps stay off until you connect it.
What you can build with Google Maps
How to get it, step by step
Create your key
- Open console.cloud.google.com and sign in. First time? Press Get Started, or press Create Project in the project list at the top.
- Turn on billing for the project and add your card when Google asks.
- Open the Maps JavaScript API page in the console and press Enable. Wait a few minutes.
- Go to Google Maps Platform, then Keys & Credentials, and choose your project.
- Press Create credentials, then API key. Under Select API restrictions, keep only Maps JavaScript API, then press Create.
- Copy the key. You can see it again later with Show key.
Lock the key to your website
- Open console.cloud.google.com/apis/credentials and press your key’s name.
- Under Application restrictions, choose Websites. Press Add, type your app’s address followed by /* (for example myshop.boodoo.ai/*), and press Done.
- Press Save.
Which value goes in which box
- Maps API key
GOOGLE_MAPS_API_KEYKeep private - The key from the last step. An “API key” is a long code that lets your app use your account — like a password for apps.
- Maps API key (for the web page)
NEXT_PUBLIC_GOOGLE_MAPS_API_KEYNot secret - The same key — the same one goes in both boxes.
Watch out for
- This key ends up visible in the web page, so lock it to your website (the second part) — otherwise anyone could use it on your card.
- Without billing turned on, the map will not load.