Skip to main content
This page demonstrates the developer experience your platform team enables for API consumers using generated SDKs. Platform teams can adapt the examples on this page when creating consumer-facing documentation to ensure a consistent and supported API consumption experience. Once your platform team has generated and distributed the client SDKs, consuming the API is straightforward. You do not need to deal with GraphQL queries, Protocol Buffer definitions, or generation tooling. You simply install a library and interact with strongly typed objects and methods native to your programming language. This guide assumes you have been provided with the package name or repository URL for the generated SDKs.
The examples below demonstrate TypeScript and Go SDKs. ConnectRPC supports many other languages including Python, Swift, Kotlin, and more. For a complete list of supported languages and their SDKs, see the official Buf documentation.

TypeScript / JavaScript example

The generated TypeScript client provides full type safety for requests and responses, along with autocomplete in your IDE.

1. Installation

Install the generated SDK package provided by your platform team, along with the required Connect runtime libraries. Note: Replace @my-org/sdk with the actual package name provided by your team.

2. Usage Example

To make a request, you create a transport (configuring the base URL) and then instantiate the client for the desired service.

Go example

The generated Go SDK provides idiomatic Go structs and interfaces for interacting with the API.

1. Installation

Download the generated Go module provided by your platform team, along with the required Connect runtime. Note: Replace github.com/my-org/sdk with the actual module path provided by your team.

2. Usage Example

Instantiate the service client using a standard HTTP client and the base URL of the router.