TopStats SDK
Java analytics SDK
Deliberately Java 8 compatible so it runs everywhere from a 1.8.8 Minecraft server to a modern Spring Boot deployment. Builder-style options, a daemon flusher thread, and jackson-databind as the only dependency. The jvm-web module adds servlet filters and a Spring Boot starter.
Install
// Maven Central soon; today: mvn install from the repo
<dependency>
<groupId>gg.topstats</groupId>
<artifactId>analytics</artifactId>
</dependency>Capture your first event
TopStatsClient client = new TopStatsClient(System.getenv("TOPSTATS_API_KEY"),
new TopStatsClientOptions().defaultSource("api"));
client.capture("batch_completed", Map.of("rows", 1200),
new CaptureContext().actor("job-42"));
client.shutdown();Behaviour you can rely on
- Capture never throws into your code and never blocks on the network - a bounded queue buffers and a background loop batches.
- Retries only 429, 5xx and network failures, with jittered backoff honouring Retry-After; your API key never appears in error output.
- HttpURLConnection transport - no HTTP client dependency, Java 8 safe.
- The Minecraft plugin shades and relocates this SDK, so servers never hit dependency clashes.