1.0.3 • Published 2 months ago

nice-grpc-client-middleware-devtools v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

nice-grpc-client-middleware-devtools npm version

Client middleware for nice-grpc that enables seeing grpc-web requests in grpc-web-tools.

Installation

npm install nice-grpc-client-middleware-devtools

Usage

import {
  createClientFactory,
  createChannel,
  ClientError,
  Status,
} from 'nice-grpc';
import {devtoolsLoggingMiddleware} from 'nice-grpc-client-middleware-devtools';

const clientFactory = createClientFactory().use(devtoolsLoggingMiddlware);

const channel = createChannel(address);
const client = clientFactory.create(ExampleService, channel);

const response = await client.exampleMethod(request);
// The request and response will be visible in the Browser extension

Alternatively, only logging for unary requests can be achieved by using devtoolsUnaryLoggingMiddleware or logging for streaming requests by using devtoolsStreamLoggingMiddleware.

1.0.3

2 months ago

1.0.2

7 months ago

1.0.1

7 months ago