Kotlin
Use the Loams Kotlin SDK (dev.loams:loams-kotlin) and make the first call.
The Kotlin SDK runs on Java 11 or newer, and its only runtime dependencies are protobuf-java and the Kotlin standard library. Every call is synchronous, so it needs no coroutines dependency; call it from a suspend function with withContext(Dispatchers.IO). It is a separate artifact from the Java SDK; use one or the other.
Experimental
dev.loams:loams-kotlin 0.1.0 is on Maven Central. The SDK is experimental: its API can
change between releases, so pin the exact version.
Examples: github.com/ostrium-labs/loams-kotlin · Source: sdks/kotlin
Install
From Maven Central:
dependencies {
implementation("dev.loams:loams-kotlin:0.1.0")
}Quickstart
import dev.loams.LoamsClient
import dev.loams.StaticTokenSource
fun main() {
val client = LoamsClient(
endpoint = System.getenv("LOAMS_ENDPOINT") ?: "http://127.0.0.1:8080",
tokenSource = System.getenv("LOAMS_API_KEY")?.let { StaticTokenSource(it) },
)
// What this instance is; needs no credential.
println(client.getInstance())
println(client.apiVersions())
}apiVersions() is the list to feature-detect from: a package this instance does not serve answers unimplemented with reason feature_not_in_variant.
Build and test
cd sdks/kotlin
./build.sh test