We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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?
The text was updated successfully, but these errors were encountered:
@codan84 what did you end up doing ?
@sofisl did you have time to look into this ?
Sorry, something went wrong.
I ended up using fetch and hitting your APIs directly
I haven't tested this myself yet, but tracing through some of the dependencies that the client library pulls in, you can use google-auth-library to create a JWT AuthClient instance using [fromAPIKey(apiKey: string, options?: AuthClientOptions)](https://github.com/googleapis/google-auth-library-nodejs/blob/7dbedff829be093dad0a2da32f0ab12862d473bc/src/auth/googleauth.ts#L812]
JWT
fromAPIKey(apiKey: string, options?: AuthClientOptions)
This can then be injected into AddressValidationClient to override the default auth mechanisms.
const options = { authClient: fromAPIKey("my-api-key"), }; const apiClient = new AddressValidationClient(options);
See also:
sofisl
No branches or pull requests
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: