100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Web

gRPC-Web

AdvancedTechnique4.4K learners

gRPC-Web is a JavaScript client library and protocol that lets browser-based applications call gRPC services, working around the fact that browsers cannot make native gRPC calls over HTTP/2.

Definition

gRPC-Web is a JavaScript client library and protocol that lets browser-based applications call gRPC services, working around the fact that browsers cannot make native gRPC calls over HTTP/2.

Overview

gRPC is a high-performance RPC framework that relies on HTTP/2 features — like trailers and bidirectional streaming — that web browsers do not expose through their standard networking APIs. gRPC-Web solves this by defining a compatible protocol that browsers can speak using standard HTTP requests, paired with a JavaScript/TypeScript client library that mimics the generated gRPC client code used in backend services. Because browsers cannot call gRPC services directly, gRPC-Web requests typically pass through a proxy — most commonly Envoy — that translates between the browser-friendly gRPC-Web protocol and native gRPC on the backend. This adds an infrastructure requirement compared to calling a plain REST API or GraphQL endpoint directly from a browser, which is one reason gRPC-Web is more common in internal tooling and microservice-heavy organizations than in typical public web APIs. When it fits, gRPC-Web brings the same benefits as gRPC generally — strongly typed contracts via Protocol Buffers, efficient binary serialization, and generated client code — to browser-based frontends built with frameworks like React, making it attractive for teams that already use gRPC extensively across their backend Microservices.

Key Concepts

  • Browser-compatible variant of the gRPC protocol
  • Generated, strongly typed client code from Protocol Buffer definitions
  • Requires a proxy (commonly Envoy) to translate to native gRPC
  • Efficient binary serialization compared to JSON-based REST
  • Supports server-side streaming from browser clients
  • Shares service definitions with backend gRPC services
  • Reduces duplication between frontend and backend API contracts
  • Works alongside existing REST or GraphQL endpoints where needed

Use Cases

Browser clients calling backend services already built on gRPC
Internal dashboards and tools within microservice-heavy organizations
Sharing a single API contract (via Protocol Buffers) across web and backend
High-throughput, low-latency communication between frontend and services
Streaming server-to-client updates in web applications

Frequently Asked Questions