-
Notifications
You must be signed in to change notification settings - Fork 652
Closed
Labels
Description
If you copy the code snippet from the Quick Start, you will encounter an error message stating "The provided API key is invalid". This happens because the code example doesn't explicitly indicate that "key" refers to the API key. Unlike other samples below that specifically mention process.env.GOOGLE_MAPS_API_KEY
, this crucial detail should also be included in the quick start code:
const client = new Client({});
client
.elevation({
params: {
locations: [{ lat: 45, lng: -110 }],
key: "asdf",
},
timeout: 1000, // milliseconds
})
.then((r) => {
console.log(r.data.results[0].elevation);
})
.catch((e) => {
console.log(e.response.data.error_message);
});