TopStats SDK

Rust analytics SDK

A worker-thread design with a level-triggered signal - capture() locks, enqueues and returns. serde/serde_json/ureq are the only dependencies. The topstats-tower and topstats-actix crates wrap it for Axum, hyper and Actix Web.

Install

# crates.io soon; today:
topstats-analytics = { git = "https://github.com/top-stats/analytics-rust-sdk" }

Capture your first event

let client = Client::builder(std::env::var("TOPSTATS_API_KEY")?)
    .default_source("api")
    .build()?;

client.capture("crash_reported", Some(props), CaptureOptions {
    actor: Some("device-11".into()),
    ..Default::default()
});

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.