googleapis / nodejs-web-risk

This repository is deprecated. All of its content and history has been moved to googleapis/google-cloud-node.
https://cloud.google.com/web-risk/
Apache License 2.0
18 stars 10 forks source link

feat: deferred client initialization #123

Closed alexander-fenster closed 4 years ago

alexander-fenster commented 4 years ago

This PR includes changes from https://github.com/googleapis/gapic-generator-typescript/pull/317 that will move the asynchronous initialization and authentication from the client constructor to an initialize() method. This method will be automatically called when the first RPC call is performed.

The client library usage has not changed, there is no need to update any code.

If you want to make sure the client is authenticated before the first RPC call, you can do

await client.initialize();

manually before calling any client method.