The remote generation alpha was deprecated as of April 30, 2023. If you still need to migrate, see the migration guide

Protobuf is a fantastic way to programmatically define your APIs and generate away a lot of the common work we perform as software engineers to communicate across our services. Here at Buf, we believe the eventual promise of Protobuf is for us to stop publishing English-language API specs, and instead move to generated SDKs that we all consume.

Remote packages is the movement towards this promise. With remote packages, Buf will take your modules and Protobuf plugins, add a little elbow grease, and generate full-serve packages for you to consume just like any third-party library in your native programming language. This means you don't have to worry about Protobuf code generation at all - you can push modules to the BSR and install code stubs generated from those modules using dependency management tools like NPM, Go, Maven, Gradle, and Swift.

  • Zero tooling required — forget about plugins and Protobuf compilers entirely.
  • API producers can provide two lines of installation instructions instead of publishing their own SDKs.
  • No need to manually keep plugins and supporting library versions in sync.
  • Dependabot and other tools can pick up version changes.
  • Take advantage of existing organization-wide caching.

Go

# Get the Connect client and server packages for the buf.build/connectrpc/eliza module
$ go get buf.build/gen/go/connectrpc/eliza/connectrpc/go

NPM

# Install the Connect client packages for the buf.build/connectrpc/eliza module
$ npm config set @buf:registry https://buf.build/gen/npm/v1
$ npm install @buf/connectrpc_eliza.bufbuild_connect-es

Maven

pom.xml
<repositories>
  <!-- ... -->
  <repository>
    <name>Buf Maven Repository</name>
    <id>buf</id>
    <url>https://buf.build/gen/maven</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
  </repository>
</repositories>
<dependencies>
  <!-- ... -->
  <dependency>
    <groupId>build.buf.gen</groupId>
    <artifactId>connectrpc_eliza_bufbuild_connect-kotlin</artifactId>
    <version>0.1.8.3.20230727062025.d8fbf2620c60</version>
  </dependency>
</dependencies>

Swift

Integrating remote packages with Xcode works in the same way as adding a Swift package from any other git repository. For example:

Package-URL
# Example URL
https://buf.build/gen/swift/git/0.8.0-20230913231627-233fca715f49.1/connectrpc_eliza_connectrpc_swift.git

For detailed instructions, see the documentation.

Supported languages

The BSR currently supports Remote Packages for these languages:

We plan to support Remote Packages for additional languages in the near future, including (in rough priority order):

  • Python
  • C#
  • Ruby