TopStats SDK

Kotlin analytics SDK

Kotlin-first rather than a thin Java wrapper: default arguments instead of builders, data classes for context and flags, jackson-module-kotlin under the hood. The jvm-web module adds a Ktor plugin with route-template request analytics.

Install

// Maven Central soon; today: mvn install from the repo
gg.topstats:analytics-kotlin

Capture your first event

val client = TopStatsClient(
    apiKey = System.getenv("TOPSTATS_API_KEY"),
    defaultSource = "api",
)

client.capture("sync_finished", mapOf("items" to 87),
    CaptureContext(actor = "tenant-5"))
client.close()

Behaviour you can rely on

Every other language

Your first event is minutes away.

Twelve language SDKs, middleware for nine web frameworks, plugins for seven games, and raw HTTP - all working today. Free plan, 2M events a month, no card.