google-cloud-node icon indicating copy to clipboard operation
google-cloud-node copied to clipboard

Authenticating for @googlemaps/addressvalidation with an API key

Open codan84 opened this issue 11 months ago • 4 comments

According to the docs/examples of Google Address Validation we can use an API key to authenticate:

curl -X POST -d '{
  "address": {
    "regionCode": "US",
    "locality": "Mountain View",
    "addressLines": ["1600 Amphitheatre Pkwy"]
  }
}' \
-H 'Content-Type: application/json' \
"https://addressvalidation.googleapis.com/v1:validateAddress?key=API_KEY"

https://developers.google.com/maps/documentation/address-validation/requests-validate-address

However, I can't see any reference/docs as to how I can use said API key when using SDK: https://www.npmjs.com/package/@googlemaps/addressvalidation

Nor can I see any reference to that in https://github.com/googleapis/google-auth-library-nodejs

Any clues? Or am I restricted to making http calls (fetch, axios etc) from my node app in order to achieve this?

codan84 avatar Feb 29 '24 12:02 codan84