Skip to main content
The Outlit Rust SDK records product activity in native applications and backend services:
  • Desktop apps - Tauri, native GUI applications
  • CLI tools - Command-line applications
  • Backend services - Rust-based APIs
For anonymous tracking before user sign-in, use fingerprint. See Device Tracking for details. To capture how someone first arrived and browsed your website, use the Outlit Browser SDK and identify that browser visitor when their email becomes available. An email-only server identify cannot link an otherwise anonymous browser visit.

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 your value milestone as an ordinary event once it succeeds:
Choose this event as your activation event in Outlit. The first matching event records activation once for each eligible resolved person and company, independently. Billing status comes from verified integrations such as Stripe. See Customer journey.

client.flush()

Immediately send all queued events.

client.shutdown()

Shut down gracefully: flushes remaining events and stops the timer.
Always call shutdown() or flush() before your application exits to ensure all events are sent.

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 returns Result<(), outlit::Error> for operations that can fail:

Next steps

Device tracking

Anonymous tracking before user identification

Identity resolution

How activity links across identifiers