Given the protocol buffers definition available at: https://github.com/googleapis/googleapis/blob/master/google/home/graph/v1/homegraph.proto
How can one call the Home Graph API RPC endpoint using gRPC on Node.js to multiplex concurrent API method calls over a single connection?
You can use @grpc-js in combination with Application Default Credentials to initialize the credentials.
Use google-proto-files with @grpc/proto-loader to load the Home Graph service protobuf definition with its dependencies.
And finally initialize client stubs to call the HomeGraphApiService methods.
Note that by default the
Channel
implementation will reuse existing channels from a global pool if the parameters (address, credentials and options) are the same. You can alter this behavior with thegrpc.use_local_subchannel_pool
option.