-
Notifications
You must be signed in to change notification settings - Fork 598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authenticating for @googlemaps/addressvalidation with an API key #5099
Comments
I ended up using fetch and hitting your APIs directly |
I can confirm that this works. I was looking for any easy way to move from manual HTTP requests to the new Places SDK and here is how you can create the client: import { v1 as PlacesApiV1 } from '@googlemaps/places';
import { JWT } from 'google-auth-library';
const { PlacesClient } = PlacesApiV1;
const authClient = new JWT();
authClient.fromAPIKey('my-api-key');
const placesClient = new PlacesClient({
authClient,
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
According to the docs/examples of Google Address Validation we can use an API key to authenticate:
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?
The text was updated successfully, but these errors were encountered: