A TypeScript-first gRPC-Web client library for browsers. Current stable version is 3.3.10 with monthly releases. Key differentiators: full TypeScript support, async iterable for server-streaming, AbortController for cancellation, and client middleware for interceptors. Compliant with the official gRPC-Web specification, works with protobuf-es or protobufjs. Unlike grpc-web, it provides a Promise-based API with proper TypeScript types and supports cancelation.
npm install nice-grpc-webNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a gRPC-Web client from a service definition and client class generated by protobuf-es.
Use ESM imports or switch to dynamic import() in CJS projects.
Pass the generated client class (e.g., GreeterClient) as the second argument.
Use protobuf-es as the protobuf runtime for full type safety.
Pass signal from an AbortController instead of the controller itself.
Use for await...of instead of listening to events.
Add "type": "module" to package.json or rename file to .mjs.
Pass the generated client class (e.g., GreeterClient) as the second argument.
Import and configure a transport like @nice-grpc/grpc-web-transport.