pbts-grpc-transcoder is a TypeScript library (v0.3.2) that provides gRPC-to-HTTP/1 JSON transcoding for protobuf.js, enabling fully-typed RPC calls over HTTP/1. It allows developers to make gRPC-style service calls using protobuf.js message types, which get automatically transcoded to HTTP/1 JSON requests based on google.api.http annotations in the service definition. Unlike envoy or grpc-gateway, this operates client-side, and is ideal for environments where HTTP/2 or gRPC-Web is unavailable. It requires protobuf.js as a peer dependency and uses a JSON descriptor file. Release cadence is low; no recent updates.
npm install pbts-grpc-transcoderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up a GrpcTranscoder instance from a JSON descriptor and makes a typed RPC call.
Use `pbjs -t json your.proto > descriptor.json` to generate the descriptor.
Set custom headers via `headers` option instead for clarity.
Update code to handle protobuf.Message instances; call .toJSON() if plain object needed.
Use GrpcTranscoder.transcode() instead of creating a stub.
Always set `apiKey` or `headers` in the constructor.
Use protobuf.Root.fromDescriptor(descriptor) to create the Root.
Check that you're using v0.2.0+ and that transcoder is an instance of GrpcTranscoder.
Use `import` syntax and ensure package is installed: `npm install pbts-grpc-transcoder`.
Add HTTP options to your proto definition and regenerate the descriptor.