sdk-typescript
sdk-typescript copied to clipboard
[Feature Request] Enable in-browser usage of gRPC client
Is your feature request related to a problem? Please describe.
Some users have indicated interest in being able to use the gRPC client in the browser. Enable this.
Describe the solution you'd like
Solution probably will need to leverage https://github.com/grpc/grpc-web
Additional context
Client package needs to be free of deps on not-just-proto core code
We could make @temporalio/client
work in the browser by replacing grpc-js
with grpc-web
perhaps even in the same package, e.g. https://github.com/lquixada/cross-fetch.
See related discussion here: https://temporalio.slack.com/archives/CTRCR8RBP/p1639166317413200
Note of course that this requires server-side support, it's not a drop-in solution. May be worth looking into existing/new efforts of REST-ifying the server instead.
Yes, I'm aware.
It makes a lot of sense to me to expose grpc web endpoints especially because we already have a type-safe JS client which (with minimal effort) could be used in the browser.
Note of course that this requires server-side support, it's not a drop-in solution. May be worth looking into existing/new efforts of REST-ifying the server instead.
Not necessarily. I am currently using grpc-web
from the browser via envoy-proxy, which translates the web requests for the frontend. A simple sidecar or built-in proxy could do as well (e.g. https://github.com/improbable-eng/grpc-web/tree/master/go/grpcwebproxy)
Not necessarily. I am currently using grpc-web from the browser via envoy-proxy,
To clarify, this is what I meant by server-side support. Something must be setup on the server side currently. A built-in proxy makes plenty of sense in the Temporal server and is worth a discussion for sure.
Currently it does not support working in temporal/client browser, is it true?
We're working on an HTTP/1.1 API that can be used to back running the TS SDK client in a browser.
https://github.com/temporalio/api/pull/301