Analytics API Guide
Learn how to retrieve analytics and insights using the Wacht Rust SDK.Prerequisites
Before using any API methods, you must initialize the SDK:Fetch Analytics Summary
Get overall statistics for your deployment with optional date filtering.Basic Statistics
With Date Range
Get Recent Signups
Retrieve the most recent user registrations.Basic List
With Limit
Get Recent Sign-ins
Retrieve the most recent user authentication events.Basic List
With Limit
Understanding the Response
AnalyticsStatsResponse Fields
signups(i64) - Number of new sign-ups in the periodunique_signins(i64) - Number of unique sign-ins in the periodorganizations_created(i64) - Number of organizations created in the periodworkspaces_created(i64) - Number of workspaces created in the periodtotal_signups(i64) - Total sign-ups all timesignups_change(Option<f64>) - Percentage change from previous periodunique_signins_change(Option<f64>) - Percentage change from previous periodorganizations_created_change(Option<f64>) - Percentage change from previous periodworkspaces_created_change(Option<f64>) - Percentage change from previous period
RecentSignup Fields
user_id(String) - User IDemail(String) - User emailfirst_name(String) - User first namelast_name(String) - User last namesigned_up_at(String) - Sign-up timestamp (ISO 8601)method(String) - Sign-up method (e.g., “password”, “oauth”)
RecentSignin Fields
user_id(String) - User IDuser_email(String) - User emailsigned_in_at(String) - Sign-in timestamp (ISO 8601)method(String) - Sign-in method (e.g., “password”, “otp”, “oauth”)ip_address(String) - IP address of the sign-inuser_agent(String) - User agent string
Builder Methods
FetchStatsBuilder
options(AnalyticsStatsOptions)- Set date range for statistics
FetchRecentSignupsBuilder
limit(u32)- Number of results to return (max 100)
FetchRecentSigninsBuilder
limit(u32)- Number of results to return (max 100)
Error Handling
All SDK methods return aResult<T, Error>:
Related
- Installation - SDK setup
- Users Guide - User management
- Organizations Guide - Organization management
- API Reference - Backend API - Full API docs
