Expand description
A small, typed client for Umami’s public analytics ingestion API.
rust-umami intentionally focuses on sending analytics. It never logs in,
stores an API key, or calls Umami’s reporting and administration APIs.
§Quick start
use rust_umami::Client;
use serde_json::json;
let umami = Client::new(
"https://analytics.example.com",
"aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
)?;
umami
.event("signup")
.url("/pricing")
.data(json!({ "plan": "pro" }))
.send()
.await?;A Client is stateless and safe to reuse across visitors. For a sequence
of calls from one visitor, create a Session; it transparently reuses
Umami’s cache value while remaining isolated from other sessions.
Re-exports§
pub use serde_json;
Structs§
- ApiError
- An error returned by Umami for a non-successful HTTP response.
- Batch
- Builder for sending up to 500 tracks in a single HTTP request.
- Batch
Error - Per-item error returned inside a batch response.
- Batch
Response - Summary returned by Umami’s batch ingestion endpoint.
- Client
- Async client for Umami’s unauthenticated analytics ingestion API.
- Client
Builder - Builder for
Client. - Context
- Visitor and page information attached to an analytics event.
- Session
- Per-visitor tracking state with automatic Umami cache reuse.
- Track
- A fluent analytics track ready to send.
- Track
Response - Response returned after sending one analytics track.
Enums§
- Error
- Errors produced while configuring the client or sending analytics.
- Track
Kind - The collection type understood by Umami’s ingestion endpoint.
Constants§
- CLOUD_
ENDPOINT - Current Umami Cloud collection endpoint.
Type Aliases§
- Result
- Result type used throughout the crate.