Skip to content

Connect API Clients

Connect provides code generated API clients! They save developers time and effort, while ensuring consistency and maintainability. With type safety, IDE support, and language compatibility, these clients streamline the integration process, abstract away complexities, and empower developers to focus on building robust and scalable applications.

Provided by Connect Plugin

As a plugin developer you can depend on Connect Plugin in your plugin's dependencies. Make sure that your plugin.yml has a depend: [ connect ] to ensure that the Connect Plugin is loaded before your plugin.

The Connect Plugin provides authenticated stubs to the Connect API through the ConnectApi global instance.

java
com.minekube.connect.api.ConnectApi.getInstance().getClients()...

Simply add the connect-java:api dependency to your project using Gradle or Maven with the Jitpack repository.

kotlin
repositories {
  maven("https://jitpack.io")
}

dependencies {
  api("com.github.minekube.connect-java:api:latest")
}
groovy
repositories {
  maven { url 'https://jitpack.io' }
}

dependencies {
    api 'com.github.minekube.connect-java:api:latest'
}
xml

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
<dependency>
    <groupId>com.github.minekube.connect-java</groupId>
    <artifactId>api</artifactId>
    <version>latest</version>
    <scope>provided</scope>
</dependency>
</dependencies>

Checkout Code Examples to see it in action.

Other languages

You can also use Buf Remote Packages that provide client libraries for many programming languages for the Connect API. Make sure to include the required request header to Authenticate self-built clients with the Connect API.

Supported languages:

For example, to add the following modules to your Go project:

shell
go get github.com/bufbuild/connect-go@latest
go get buf.build/gen/go/minekube/connect/bufbuild/connect-go@latest
go get buf.build/gen/go/minekube/connect/protocolbuffers/go@latest

Checkout Code Examples for code examples in different languages.


Buf Remote Packages

Not affiliated with Mojang nor Minecraft