Skip to main content
The official Expys data SDK for Kotlin/JVM: coroutine-native (suspend), OkHttp, and kotlinx.serialization. A single pure-Kotlin/JVM artifact (no Android resources, no Android Gradle Plugin) that runs identically for Android and server consumers.
Beta. The generated models and transport are stable to use; the ergonomic layer is hardening during the rollout window. Pin an exact version in production and review the versioning policy.

Install

The artifact is published to Maven Central as com.expys:sdk.

Initialize

The client is constructed with ExpysClient.create(ExpysConfiguration(...)). The token is a short-lived member token your backend obtained from POST /v1/auth/exchange - never your Org-API-Key.
All calls are suspend functions; call them from a coroutine. Cancellation propagates cleanly and is never retried. Provide a refreshToken lambda and the SDK refreshes the member token automatically near expiry and once on a 401; it must call your backend and return a TokenRefresh(accessToken = ...). See Authentication for the full contract.

Configuration

ExpysConfiguration carries the shared configuration vocabulary - baseUrl, maxRetries, timeoutMs, tokenExpiresAtMs, refreshSkewMs, and more. ExpysClient.create(configuration, httpClient) accepts an optional HttpClient to inject a custom transport for instrumentation or testing. Here it is alongside the TypeScript and Swift equivalents:
The full option table, with defaults and per-language types, lives in the configuration reference.

Errors

Calls throw ExpysException. Catch ExpysException.Api and branch on the error’s kind and stable code:
ExpysException subtypes are Api(ApiError), Network(detail), Timeout, Decoding(detail), and NotConfigured(detail). ApiError carries status, the stable envelope code, message, optional retryAfterMs (milliseconds, matching the TS and Swift SDKs), optional requestId, and a coarse kind. Treat an unknown code as the generic class for its kind. See Errors.

Streaming with Flow

streamMessages(id) returns a cold Flow<Message> of new, member-visible concierge messages over Server-Sent Events. Collect it to subscribe; cancelling collection (for example, cancelling the collecting coroutine’s scope) tears down the connection. See Streaming.

Platform support

A single pure-Kotlin/JVM artifact that runs unchanged on the server and on Android.
  • JVM: Java 17+ (the artifact targets JVM 17 bytecode).
  • Android: consumable from an app compiling against Java 17 (Android Gradle Plugin 8+). The transport is OkHttp 4.12 (Android API 21+).
    • minSdk: parsing RFC 7231 Retry-After dates uses java.time, which needs API 26+, or API 21+ with core library desugaring enabled.
    • R8/ProGuard: keep rules ship inside the artifact, so R8 applies them automatically with no app-side config.
The SDK sends no telemetry.

Next steps

Authentication

Minting member tokens and the refresh lambda.

Configuration

Every option with its default and Kotlin type.

Streaming

Collecting the concierge message Flow.

API reference

Every endpoint, with a live “Try it” playground.