connectrpc
2.0.1, released 4 weeks ago by connectrpc.com
Implementation of the Connect protocol for Dart, supporting Protobuf, gRPC, and gRPC-Web.
What it does
Connect-Dart provides type-safe and idiomatic Dart clients to communicate with application servers using Protocol Buffers. It works with the Connect, gRPC, and gRPC-Web protocols, generating clean client code from your Protobuf schemas.
AI-written summary of version 2.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are using Protocol Buffers for your backend API communication.
- You need to support Connect, gRPC, or gRPC-Web protocols in your Dart application.
- You want type-safe, generated clients with support for unary and streaming RPCs.
Skip it when
- Your backend relies solely on REST/JSON APIs without gRPC or Connect support.
- You prefer writing manual HTTP requests over code generation.
Strengths
- Type-safe and idiomatic clients generated from Protobuf schemas.
- Supports Connect, gRPC, and gRPC-Web protocols.
- Handles both unary calls and bi-directional or server streaming out of the box.
Weaknesses
- Requires using Protocol Buffers and code generation setup.
- Depends on the V6 Protobuf runtime and requires Dart 3.7.
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 4
Requires defining Protobuf schemas and generating Dart client code, as well as importing the required runtime dependencies.
void main() async {
late ElizaServiceClient elizaClient;
final response = await elizaClient.say(SayRequest(sentence: "Hey!"))
print(response.message);
}Alternatives
Packages that do the same job and could replace connectrpc.
- grpc
Dart implementation of gRPC, a high performance universal RPC framework.
90Compare - dart_pusher_channels
Pure‑Dart client for the Pusher Channels real‑time protocol.
65Compare
Works with
Packages commonly used together with connectrpc: ones it builds on, ones built on it, and its own family.
- fixnumconnectrpc depends on itProvides 32‑ and 64‑bit signed fixed‑width integer types for Dart.
- protobufconnectrpc depends on itProvides runtime support for Dart protocol buffer messages generated by protoc_plugin.
- http2connectrpc depends on itAn HTTP/2 implementation in Dart for low-level transport and pooled HTTP/2 requests.