- Home
- Code Generators
- ts-proto
ts-proto
What it is
ts-proto is a code generator that turns .proto files into strongly typed TypeScript. It creates message interfaces with encode, decode, toJSON, and fromJSON methods, and generates service types and client implementations for Twirp, grpc-web, grpc-js, and NestJS. Its output is designed for TypeScript and favors interfaces over classes where possible. The generator maps Protobuf well-known types such as wrappers and Struct to corresponding TypeScript or JSON types, and maps timestamps to Date by default, with configurable alternatives including strings and Temporal.Instant.
The project works as a protoc plugin, with documented integrations for Buf and the protobuf Gradle plugin. Twirp clients can batch matching RPC calls when the documented convention is used. ts-proto supports compile-time generation, but not runtime reflection or loading dynamic .proto files; it also does not generate clients for google.api.http-based Google Cloud APIs. The project is open source under Apache-2.0 and is listed as free at no cost.
For and against
For
- Generates typed message interfaces and JSON conversion methods.
- Supports Twirp, grpc-web, grpc-js, and NestJS clients.
- Integrates with protoc, Buf, and the Gradle plugin.
- Maps timestamps to Date by default.
- Free and Apache-2.0 licensed.
Against
- No runtime reflection or dynamic .proto loading.
- No clients for google.api.http-based Google Cloud APIs.
The verdict
ts-proto provides compile-time Protobuf-to-TypeScript generation, with message methods and clients for several service frameworks. Check its documented limits if your workflow depends on runtime schemas or Google Cloud API clients.
Who it suits
ts-proto suits TypeScript developers generating code from Protobuf schemas who need message serialization methods or clients for its supported service frameworks. It may not suit workflows requiring dynamic schema loading or clients for google.api.http-based Google Cloud APIs.
Plans and prices
ts-proto
Apache-2.0 licensed open-source repository
Read 11 Oct 2026 · github.com
On the record
- Batching
- Twirp clients can automatically batch matching RPC calls to help prevent N+1 requests.github.com · read 11 Oct 2026
- Buf integration
- The README documents configuring ts-proto with Buf and says an official plugin is published to the Buf Registry.github.com · read 5 Oct 2026
- Generated code
- Generated message code includes encode, decode, toJSON, and fromJSON methods.github.com · read 11 Oct 2026
- Google APIs limit
- The README says clients for google.api.http-based Google Cloud APIs are not supported.github.com · read 11 Oct 2026
- Gradle integration
- The README documents invoking ts-proto through the protobuf-gradle-plugin.github.com · read 5 Oct 2026
- Install and use
- The quick start installs ts-proto with npm and invokes it as a protoc plugin.github.com · read 5 Oct 2026
- Integrations
- The README documents use with protoc, Buf, and the protobuf Gradle plugin.github.com · read 11 Oct 2026
- License
- The repository is published under the Apache-2.0 license.github.com · read 11 Oct 2026
- Purpose
- ts-proto transforms .proto files into strongly typed, idiomatic TypeScript files.github.com · read 11 Oct 2026
- RPC scope
- The README says ts-proto is not an out-of-the-box RPC framework.github.com · read 11 Oct 2026
- Runtime reflection
- The project supports compile-time .proto-to-.ts code generation and does not support runtime reflection or loading of dynamic .proto files.github.com · read 11 Oct 2026
- Serialization
- Version 2.x migrated low-level protobuf serialization from protobufjs to @bufbuild/protobuf.github.com · read 11 Oct 2026
- Service clients
- It generates service types and client implementations for Twirp, grpc-web, grpc-js, and NestJS.github.com · read 5 Oct 2026
- Service support
- It generates service types and client implementations for Twirp, grpc-web, grpc-js, and NestJS.github.com · read 11 Oct 2026
- Support
- The maintainer offers customizations or priority support for companies by email.github.com · read 11 Oct 2026
- Type mappings
- It maps protobuf timestamps to Date by default and supports configurable representations including strings and Temporal.Instant.github.com · read 11 Oct 2026
- TypeScript style
- The project aims for TypeScript-first, idiomatic output and uses interfaces instead of classes where possible.github.com · read 5 Oct 2026
- Unsupported clients
- The README says it does not support clients for google.api.http-based Google Cloud APIs.github.com · read 5 Oct 2026