outlit
Outlit analytics SDK for Rust.
Installation
Add to your Cargo.toml:
[]
= "0.1"
= { = "1", = ["rt-multi-thread", "macros"] }
Quick Start
use ;
use Duration;
async
Configuration
let client = builder
.api_host // default: https://app.outlit.ai
.flush_interval // default: 10 seconds
.max_batch_size // default: 100
.timeout // default: 10 seconds
.build?;
Identity
All methods require identity (email or user_id). Use the helper functions:
use ;
// Track with email
client.track.send.await?;
// Track with user_id
client.track_by_user_id.send.await?;
// Add both identifiers
client.track
.user_id // optionally add the other
.send
.await?;
API Reference
Track
client.track
.property
.property
.timestamp // optional custom timestamp
.send
.await?;
Identify
Unlike the browser SDK which links anonymous visitors to users, identify() in
the Rust SDK is for updating user traits when your app learns new information.
client.identify
.user_id
.trait_
.trait_
.send
.await?;
User Journey Stages
client.user.activate.send.await?;
client.user.engaged.send.await?;
client.user.inactive.send.await?;
Customer Billing
client.customer.trialing.send.await?;
client.customer.paid
.customer_id
.stripe_customer_id
.send
.await?;
client.customer.churned
.property
.send
.await?;
Lifecycle
// Force flush pending events
client.flush.await?;
// Shutdown (flushes and stops background tasks)
client.shutdown.await?;
License
MIT