A code generator and runtime for RPC stubs from gRPC proto files, targeting TypeScript. Current version 3.2.3. Supports h1 transport (grpc, grpc-web, grpc-web+proto, JSON) and WebSocket for streaming. Generates client and server stub code. Supports repeated fields and enums but not maps. Notable: known issue with client stream message processing not in time. Differentiator: lightweight, browser-friendly, with WebSocket support for full streaming.
npm install wsgrpcNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Generates TypeScript stubs from a .proto file using the CLI, then uses the generated client to call a unary RPC method.
Use import syntax and set "type": "module" in package.json, or use .mjs extension.
Use await generateStub() or callback pattern if migrating from v2.
Replace imported symbol with GrpcWebClient.
Use WsClient with websocket transport for streaming RPCs.
Avoid heavy message rate in client streaming; use buffering or increase Throttle limit if configurable.
Avoid map types in proto; use repeated key-value messages instead.
Switch to import syntax or use dynamic import() in CJS context.
Use import { generateStub } from 'wsgrpc';Specify correct transport: 'grpc-web' for base64, 'grpc-web+proto' for binary, etc.
Change to WsClient and use WebSocket transport.