Overview
The Rust SDK is designed for native applications where you need tracking outside of a browser context:- Desktop apps - Tauri, native GUI applications
- CLI tools - Command-line applications
- Embedded systems - IoT devices, kiosks
- Backend services - Rust-based APIs
For anonymous tracking before user sign-in, use
fingerprint. See Device Tracking for details.Installation
The SDK is async and requires a tokio runtime. Most async frameworks (Tauri, Axum, Actix) already include tokio.
Quick Start
Configuration
Options
&str
required
Your organization’s public key.
&str
default:"https://app.outlit.ai"
API endpoint for sending events.
Duration
default:"10s"
How often to automatically flush events.
usize
default:"100"
Maximum events per batch before auto-flush.
Duration
default:"10s"
HTTP request timeout.
API Reference
client.track(event_name, identity)
Track a custom event.
Builder Methods
&str
Add email to the event (if not primary identity).
&str
Add user ID to the event.
&str
Add device fingerprint for linking.
(&str, impl Into<Value>)
Add a property to the event. Call multiple times for multiple properties.
i64
Set custom timestamp (milliseconds since epoch).
client.identify(identity)
Identify a user and optionally link device events.
&str
Device identifier. All events tracked with this fingerprint are retroactively linked to the user.
&str
Your internal user ID.
(&str, impl Into<Value>)
Add a trait to the user profile.
Lifecycle and billing
Track the ordinary event selected as your activation signal after the milestone succeeds:client.flush()
Immediately send all queued events.
client.shutdown()
Gracefully shutdown: flushes remaining events and stops the timer.
Tauri Integration
For Tauri desktop apps, initialize the client in your Rust backend.This example uses the
uuid crate for generating device IDs. Add it with cargo add uuid --features v4.Error Handling
The SDK returnsResult<(), outlit::Error> for operations that can fail:
Next Steps
Device Tracking
Anonymous tracking before user identification
Identity Resolution
How profiles are merged across identifiers