An example use of this function.
import { Client } from '@googlemaps/google-maps-services-js';
const args = {
params: {
key: '<your-api-key>',
address: 'Perth 4WD & Commercial Centre',
}
};
const client = new Client();
client.geocode(args).then(gcResponse => {
const str = JSON.stringify(gcResponse.data.results[0]);
console.log(`First result is: ${str}`);
});
Client is a light wrapper around API methods providing shared configuration for Axios settings such as retry logic using the default retry-axios settings and gzip encoding.
Instantiate with defaults
Instantiate with config
Instantiate with axiosInstance Advanced