SDKs
Available

Swift

Add the Loams Swift package and make the first call.

One Loams client with namespaced modules, speaking Connect and gRPC-Web over URLSession with no dependency.

Examples: github.com/ostrium-labs/loams-swift · Source: sdks/swift

Install

The package is the main repository; the release tag is the package version.

.package(url: "https://github.com/ostrium-labs/loams.git", from: "0.1.0")

and .product(name: "Loams", package: "loams") in the target's dependencies. Pin .upToNextMinor(from: "0.1.0") to stay on the 0.1 line.

Quickstart

import Foundation
import Loams

let client = try Loams(
    Options(
        endpoint: URL(string: "http://127.0.0.1:8080")!,
        auth: APIKeyTokenSource(ProcessInfo.processInfo.environment["LOAMS_API_KEY"] ?? "")
    )
)

// What is this instance, and what does it serve? Needs no credential.
let info = try await client.instance.getInstance()
print(info.name, info.apiVersions)

do {
    try await client.system.guard("live")
} catch let error as FeatureNotInVariantError {
    print("not in this variant:", error.variant)
}

A runnable version is in Examples/Quickstart in the SDK.

On this page