Skip to the content
Know your tech before you buy it. Makers: get listed from $49/mo

ts-proto

github.com

  • Free plan
  • Windows
  • macOS
  • Linux
  • API
7.9 Club score Visit github.com

What ts-proto is

ts-proto is an open-source tool that converts Protocol Buffers .proto files into strongly typed TypeScript. Generated message code includes interfaces and methods for encoding, decoding, and converting messages to and from JSON. Its TypeScript-first approach favors idiomatic output and uses interfaces instead of classes where possible. It also maps Protobuf well-known types, including wrapper and Struct types, to corresponding TypeScript or JSON types. For services, ts-proto generates types and client implementations for Twirp, grpc-web, grpc-js, and NestJS. Twirp clients can batch matching individual RPC calls when the documented convention is used. The tool is RPC-framework agnostic: it generates code for RPC use rather than providing a framework. Installation uses npm, and ts-proto runs as a protoc plugin. The project documents Buf integration, including an official plugin in the Buf Registry, and use through the protobuf-gradle-plugin. It does not support runtime reflection, dynamic .proto loading, or clients for google.api.http-based Google Cloud APIs. The repository identifies its license as Apache-2.0.

Who it suits

ts-proto suits TypeScript developers who generate code from Protocol Buffers definitions and need service types or clients for its supported frameworks. It is not suited to workflows that require runtime reflection or dynamic .proto loading.

Good to know, and what to watch

  • Generates strongly typed TypeScript from .proto files.
  • Generated messages include JSON conversion methods.
  • Supports clients for Twirp, grpc-web, grpc-js, and NestJS.
  • Documents integration with Buf and Gradle.
  • Apache-2.0 licensed open-source project.
  • Does not support runtime reflection or dynamic .proto loading.
  • Does not generate clients for google.api.http-based Google Cloud APIs.
  • It is not an RPC framework.

ts-proto

Free

Open source

The verdict

ts-proto offers compile-time Protocol Buffers generation for TypeScript, with message methods and service client implementations for several frameworks. Check its runtime-reflection and Google Cloud API limits against your workflow before adopting it.

What the maker publishes

Batching
Twirp clients can automatically batch matching individual RPC calls to prevent N+1 calls when the documented batching convention is used. source
Batching
Twirp clients can automatically batch matching RPC calls to help prevent N+1 requests. source
Buf integration
The README documents configuring ts-proto with Buf and says an official plugin is published to the Buf Registry. source
Generated code
Generated message code includes TypeScript interfaces and encode, decode, toJSON, and fromJSON methods. source
Generated code
Generated message code includes encode, decode, toJSON, and fromJSON methods. source
Google APIs limit
The README says clients for google.api.http-based Google Cloud APIs are not supported. source
Gradle integration
The README documents invoking ts-proto through the protobuf-gradle-plugin. source
Install and use
The quick start installs ts-proto with npm and invokes it as a protoc plugin. source
Integrations
The README documents use with protoc, Buf, and the protobuf Gradle plugin. source
License
The repository identifies its license as Apache-2.0. source
License
The repository is published under the Apache-2.0 license. source
Purpose
ts-proto transforms .proto files into strongly typed, idiomatic TypeScript files. source
Purpose
ts-proto transforms .proto files into strongly typed, idiomatic TypeScript files. source
RPC scope
The project describes itself as RPC-framework agnostic and not an out-of-the-box RPC framework. source
RPC scope
The README says ts-proto is not an out-of-the-box RPC framework. source
Runtime reflection
The project supports compile-time .proto-to-.ts code generation and does not support runtime reflection or loading of dynamic .proto files. source
Serialization
Version 2.x migrated low-level protobuf serialization from protobufjs to @bufbuild/protobuf. source
Service clients
It generates service types and client implementations for Twirp, grpc-web, grpc-js, and NestJS. source
Service support
It generates service types and client implementations for Twirp, grpc-web, grpc-js, and NestJS. source
Support
The maintainer invites companies seeking customizations or priority support to contact him by email. source
Support
The maintainer offers customizations or priority support for companies by email. source
Type mappings
It maps protobuf timestamps to Date by default and supports configurable representations including strings and Temporal.Instant. source
TypeScript style
The project aims for TypeScript-first, idiomatic output and uses interfaces instead of classes where possible. source
Unsupported clients
The README says it does not support clients for google.api.http-based Google Cloud APIs. source

Checked against the maker's pages on 11 Oct 2026.