Skip to content

SDKs

Rust SDK

Send server-side events, evaluate feature flags locally and capture errors and panics from Rust.

Install

Cargo.toml
[dependencies]
tracklyne = "0.1" # sync code : { version = "0.1", default-features = false, features = ["blocking"] }
main.rs
let tl = tracklyne::Client::new("tl_your_project_token", tracklyne::Config::default().host("https://tracklyne.com"));
tl.install_panic_hook(); // optional

tl.capture(tracklyne::Event::new("invoice paid", &user.id).property("amount", 120));
tl.shutdown().await.ok(); // flush before the process exits

Feature flags and errors

main.rs
let on = tl.is_feature_enabled("new-billing", &user.id, &Default::default()).await.unwrap_or(false);

if let Err(err) = work() {
    tl.capture_exception(&err, Some(&user.id), None);
}

Async with Tokio by default, or the blocking client. Rust 1.85+.