Skip to content
TypeWire

@tahanabavi/typefetch-grpc

documents v0.0.0

gRPC transport for TypeFetch contracts — Connect unary JSON out of the box, binary grpc-web behind a codec seam, zero dependencies.

gRPC transport for TypeFetch ↗ contracts. Connect unary JSON out of the box, binary grpc-web behind a codec seam, zero dependencies — no protobuf runtime, no generated code required.

bash
npm i @tahanabavi/typefetch-grpc

Your gRPC routes join the same client, the same middleware chain, the same onError, the same retry policy and the same devtools timeline as your REST ones. That is the point: application code stops caring which wire it is on.


The wire

Connect's unary JSON protocol is the default because it is the only gRPC-family protocol that is honest HTTP — real status codes, a JSON error body, no trailers, and reproducible with curl:

txt
POST /user.v1.UserService/GetUser
Content-Type: application/json
Connect-Protocol-Version: 1
Connect-Timeout-Ms: 5000

{"id":"u_1"}

Your Zod schemas stay the source of truth. No .proto is parsed at runtime and no protobuf runtime is installed.

Already running grpc-gateway with transcoded REST paths? You need no adapter at all — that is the built-in http transport.