A protoc plugin that generates TypeScript client code for gRPC APIs exposed via grpc-gateway, powered by protobuf-es framework and bun toolchain. Version 0.4.0 integrates with buf build system, converting protobuf messages to TypeScript types and RPCs to JavaScript classes with fetch-ready Request objects. Unlike alternatives, it minimizes runtime dependencies and provides type aliases for bytes, int64, duration, and timestamp types. Requires protoc and grpc-gateway annotations (google.api.http).
npm install protoc-gen-grpc-gateway-esNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Setup and usage of protoc-gen-grpc-gateway-es with Buf to generate TypeScript client for gRPC-gateway.
Ensure Node.js >=16 and bun are installed. Use npx to invoke the plugin.
Set type: 'module' in package.json or use dynamic import() if using CommonJS.
Convert to Date: new Date(timestampString). For serialization, use date.toISOString().
Use runtime helpers to convert between BigInt and string. Do not parse as number.
Use runtime.ts helper functions for conversion: bytesToBase64, base64ToBytes.
Install as devDependency: npm install --save-dev protoc-gen-grpc-gateway-es
Ensure buf.gen.yaml output path matches the import path. Check that plugin runs successfully.
Use RPC.responseTypeId to cast the response JSON to the correct type.