gRPC-web and Google APIs

62 views
Skip to first unread message

Sachin

unread,
Oct 18, 2019, 5:26:20 PM10/18/19
to grpc.io
Hi

Need inputs on using gRPC-web with Google APIs.

Google cloud services RPC APIs to access its services e.g. https://cloud.google.com/firestore/docs/reference/rpc/ shows RPC APIs to access Firestore. 

I am trying to access the RPC APIs using gRPC-web with Envoy Proxy. But I am not getting success. 

Does does anyone done the same? Any pointers will be helpful.

Thanks,
Sachin

Wenbo Zhu

unread,
Oct 19, 2019, 9:52:15 PM10/19/19
to Sachin, grpc.io
hi Sachin,

Firestore ships SDKs for web and mobile clients. For Web, please check https://github.com/firebase/firebase-js-sdk

Direct access of Firestore via grpc-web is not supported.

- Wenbo

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/e9a3c582-0a07-4a31-b534-23ae6c6a3ed3%40googlegroups.com.

Sachin

unread,
Oct 21, 2019, 3:15:29 PM10/21/19
to grpc.io
Hi

Thanks for update. I will use SDK provided by Firestore but I could not fully understood your comment. Can you please elaborate?

My understanding is flow is as below
Browser (grpc-web)->Envoy Proxy [trancoder/translator from HTTP1.1 to HTTP2(grpc)]->Firestore.

So Firestore will get data in expected format and does not need modifications to support grpc-web. 

Let me know.

Thanks,
Sachin
 

On Saturday, 19 October 2019 18:52:15 UTC-7, Wenbo Zhu wrote:
hi Sachin,

Firestore ships SDKs for web and mobile clients. For Web, please check https://github.com/firebase/firebase-js-sdk

Direct access of Firestore via grpc-web is not supported.

- Wenbo

On Fri, Oct 18, 2019 at 2:26 PM Sachin <sachin...@gmail.com> wrote:
Hi

Need inputs on using gRPC-web with Google APIs.

Google cloud services RPC APIs to access its services e.g. https://cloud.google.com/firestore/docs/reference/rpc/ shows RPC APIs to access Firestore. 

I am trying to access the RPC APIs using gRPC-web with Envoy Proxy. But I am not getting success. 

Does does anyone done the same? Any pointers will be helpful.

Thanks,
Sachin

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grp...@googlegroups.com.

Wenbo Zhu

unread,
Oct 21, 2019, 4:12:42 PM10/21/19
to Sachin, grpc.io, Michael Lehenbauer
On Mon, Oct 21, 2019 at 12:15 PM Sachin <sachin...@gmail.com> wrote:
Hi

Thanks for update. I will use SDK provided by Firestore but I could not fully understood your comment. Can you please elaborate?

My understanding is flow is as below
Browser (grpc-web)->Envoy Proxy [trancoder/translator from HTTP1.1 to HTTP2(grpc)]->Firestore.

So Firestore will get data in expected format and does not need modifications to support grpc-web. 
It depends on which APIs you are calling. The watch API is a bidi API, which is not supported by grpc-web.

Also, I suspect there is  some non-trivial logic in the client SDK that is required to access Firestore from browsers. 

Any reason you want to use grpc-web, instead of the SDK? 



Let me know.

Thanks,
Sachin
 

On Saturday, 19 October 2019 18:52:15 UTC-7, Wenbo Zhu wrote:
hi Sachin,

Firestore ships SDKs for web and mobile clients. For Web, please check https://github.com/firebase/firebase-js-sdk

Direct access of Firestore via grpc-web is not supported.

- Wenbo

On Fri, Oct 18, 2019 at 2:26 PM Sachin <sachin...@gmail.com> wrote:
Hi

Need inputs on using gRPC-web with Google APIs.

Google cloud services RPC APIs to access its services e.g. https://cloud.google.com/firestore/docs/reference/rpc/ shows RPC APIs to access Firestore. 

I am trying to access the RPC APIs using gRPC-web with Envoy Proxy. But I am not getting success. 

Does does anyone done the same? Any pointers will be helpful.

Thanks,
Sachin

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/e9a3c582-0a07-4a31-b534-23ae6c6a3ed3%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/c607c336-9ae5-4244-8b05-6a5fc51bf7c8%40googlegroups.com.

Sachin

unread,
Oct 21, 2019, 9:31:27 PM10/21/19
to grpc.io
Hi

Got it as gRPC-web does not support bi-direction and client streams, not all APIs will be available.

As suggested, I moved to SDK now.

Also with few configuration changes in Envoy proxy, I am able to access Firestone few supported gRPC APIs. But SDK is better option.

Thanks,
Sachin

Michael Lehenbauer

unread,
Nov 4, 2019, 11:15:05 AM11/4/19
to Wenbo Zhu, Sachin, grpc.io
Using grpc-web should be fine if you don't need the bidi features (streaming writes or watch).  In addition to those features, using the web SDK gives you rich offline support (reconnects / retries, offline caching, etc.), latency compensation (the ability to see your local writes immediately without waiting for the network round-trip to reach the backend) and a very friendly API (we abstract away a lot of the complexities of the wire protocol and make it very JS friendly).

Thanks,
Michael
Reply all
Reply to author
Forward
0 new messages