nice-grpc-client-middleware-devtools
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i nice-grpc-client-middleware-devtools

Weekly Downloads

771

Version

1.0.3

License

MIT

Unpacked Size

25.9 kB

Total Files

7

Last publish

Collaborators

  • aikoven