Buf Schema Registry (BSR)

Generated SDKs – Overview

When API producer teams push schemas to the Buf Schema Registry (BSR), it automatically generates SDKs that package up code generated from their Protobuf files and plugins in multiple languages, which can be used from package managers like Cargo, Go, Gradle, Maven, NPM, pip and Swift Package Manager. Client teams can consume these SDKs using the language and tool of their choice, just like any other dependency. This greatly simplifies workflows for your teams, so they can focus on building features instead of manually generating code.

  • Natively integrate generated SDKs across backend, frontend, and mobile clients
  • Consume SDKs without worrying about your Protobuf environment, compiler, or plugins
  • Iterate on staged API changes using pre-release SDKs before merging schemas to the default label
  • Take advantage of the BSR's automatic organization-wide SDK caching
  • Automatically pick up version changes using Dependabot or similar tools

Generated SDKs work with your package manager to automatically add dependencies based on the module and plugin:

  • Buf module dependencies become package dependencies. You don't need to manually track them.

  • Many plugins generate code that requires code generated by another plugin. For example, a generated gRPC client typically requires generated Protobuf messages and other types. The generated SDK for gRPC has a package dependency for the Protobuf types, so they're automatically installed.

  • Most plugins generate code that requires a runtime library. For example, a generated gRPC client requires a gRPC networking library that's published in the ecosystem's main package registry (such as the npm public registry). These runtime dependencies are also added as package dependencies to generated SDKs, so they're automatically installed.

As a result, you only need to install a single generated SDK for what you need. The BSR gives your package manager all the information necessary to manage Buf module dependencies, plugins, and runtime dependencies for you.

In addition to simpler dependency management, generated SDKs also make iterating on Protobuf APIs easier. All labels in the BSR produce SDKs, allowing consumer teams to work with pre-release client code before pushing their APIs to the default label. Consumers can use the latest version of a generated SDK by default or pin it to a specific commit or label instead.

Go to the tutorial to learn how to install generated SDKs from the BSR, or the usage guides linked below for manual installation instructions and specific versioning syntax.

Supported languages

The BSR currently supports generated SDKs for these languages: