Prerequisites
To consume the API via standard gRPC clients, consumers need two things provided by the platform team:- Connection Details: The host and port where the router’s ConnectRPC server is listening (e.g., localhost:5026).
- Service Definitions: The service.proto file generated during the build step. This file is required to define the available services, methods, and message structures for binary serialization.
Ad-Hoc testing with grpcurl
grpcurl is a widely used command-line tool that lets you interact with gRPC servers, similar to how curl works for HTTP.
It is excellent for testing and debugging without generating code.
Command structure
To make a request, you need to pointgrpcurl to your local .proto definition file, specify the plaintext flag (unless TLS is configured), provide the request data as JSON, and specify the target endpoint and fully qualified method name.
In production environments, TLS is typically enabled and the -plaintext flag should be omitted.
Examples
The following examples assume the router is listening locally on port5026 and the proto definitions are available in a local ./services/service.proto file.
GetEmployeeById
Retrieve an employee by their ID.UpdateEmployeeMood
Update data on the server.Programmatic gRPC Clients
Whilegrpcurl is useful for testing, nearly every major programming language has robust library support for gRPC. Consumers can use standard protoc code generation tools against the provided service.proto file to build high-performance, typed clients for backend services.
For the best developer experience in languages like TypeScript, Go, and Kotlin, we recommend using the pre-generated SDKs instead of raw gRPC clients.