grpc-web-devtools icon indicating copy to clipboard operation
grpc-web-devtools copied to clipboard

Usage ?

Open kennydefie opened this issue 3 years ago • 2 comments

Installed extension and in Usage I see this:

const enableDevTools = window.GRPCWEB_DEVTOOLS || (() => {}); const client = new EchoServiceClient('http://myapi.com'); enableDevTools([ client, ]);

I added the snippet code into my own client.js file and changed client to my respective service and endpoint... reloaded the app inside chrome and I don't see anything being displayed in gRPC-Web under inspect window...

I'm confused on how to use this?

Let me know thanks,

kennydefie avatar Apr 03 '21 10:04 kennydefie

@kennydefie Have you been able to use it?

shotexa avatar Jun 01 '21 23:06 shotexa

In case anyone meet this problem, here is the solution:

The "EchoServiceClient" in document is an example, actually you need to import the service client from the generated xxxx_grpc_web_pb.js

For example, my client is chatServiceClient, so I write like this:

import { ChatServiceClient } from "./protobuffer/chat_grpc_web_pb";
const client = new ChatServiceClient("http://localhost:8080", null, null);

// for debug
const enableDevTools = window.__GRPCWEB_DEVTOOLS__ || (() => {})
enableDevTools([
  client
]);

keithleungwork avatar Jul 29 '21 11:07 keithleungwork