ModuleRpcProtocolGrpcWebClient

Client-side implementation of the gRPC-Web protocol.

see

The gRPC-Web reference implementation of a JavaScript client, based on a Protocol Buffer codec, and also this TypeScript-first implementation of a gRPC-Web client, again with Protocol Buffers.

license

Copyright (c) Aiden.ai

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Index

Interfaces

Functions

Functions

getGrpcWebClient

  • Returns an RPC client for the gRPC-Web protocol.

    see

    getRpcClient offers a more generic interface with a more intuitive "method map" service interface and is enough for most use cases.

    Type parameters

    • serviceDefinition: ServiceDefinition

      The definition of the service for which to implement a client.

    • ResponseContext

    Parameters

    • serviceDefinition: serviceDefinition
    • clientContextConnector: ClientContextConnector<ResponseContext>

      The context connector to use to inject metadata (such as authentication/authorization metadata) to the RPC. If one wishes to not inject any metadata, [[ModuleRpcContextClient.EmptyClientContextConnector]] can used.

    • options: GrpcWebClientOptions

      Various options to change the behavior of the client, include the address of the server to connect to.

    Returns Service<serviceDefinition, ResponseContext>