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.
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.
repositories {
maven("https://jitpack.io")
}
dependencies {
api("com.github.minekube.connect-java:api:latest")
}
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
api 'com.github.minekube.connect-java:api:latest'
}
<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:
- Java/Kotlin
- Golang
- JavaScript/TypeScript
- read more...
For example, to add the following modules to your Go project:
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.