rust-umami 0.1.1

An ergonomic Rust client for Umami Analytics event ingestion
Documentation
//! 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
//!
//! ```no_run
//! use rust_umami::Client;
//! use serde_json::json;
//!
//! # async fn example() -> rust_umami::Result<()> {
//! let umami = Client::new(
//!     "https://analytics.example.com",
//!     "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
//! )?;
//!
//! umami
//!     .event("signup")
//!     .url("/pricing")
//!     .data(json!({ "plan": "pro" }))
//!     .send()
//!     .await?;
//! # Ok(())
//! # }
//! ```
//!
//! 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.

#![forbid(unsafe_code)]
#![warn(missing_docs)]

mod client;
mod context;
mod error;
mod event;
mod response;

pub use client::{Batch, CLOUD_ENDPOINT, Client, ClientBuilder, Session};
pub use context::Context;
pub use error::{ApiError, Error, Result};
pub use event::{Track, TrackKind};
pub use response::{BatchError, BatchResponse, TrackResponse};

/// Re-export of `serde_json` for convenient use with [`serde_json::json!`].
pub use serde_json;