Skip to main content

Mountain/Binary/Build/
PostHogPlugin.rs

1#![allow(non_snake_case)]
2
3//! # PostHog Plugin
4//!
5//! Debug-only PostHog analytics integration. Captures lifecycle events,
6//! IPC commands, and errors during dev runs; compile-time gated to
7//! `cfg(debug_assertions)` so release builds drop the entire stack.
8//!
9//! Layout (one export per file, file name = identity):
10//! - `Initialize::Fn` - boot the global ingestion client.
11//! - `CaptureEvent::Fn` - generic event emitter with `$app` / `$component`
12//!   standard props.
13//! - `CaptureError::Fn` - emit under `mountain:error` with tag + message.
14//! - `CaptureIPC::Fn` - emit under `mountain:ipc:invoke` with method name.
15//!
16//! Module-private helpers:
17//! - `Constants` - `Authorize` / `Beam` / `Report` / `Brand` baked from
18//!   `.env.Land.PostHog`.
19//! - `Client::CLIENT` - `OnceLock<posthog_rs::Client>` singleton.
20//! - `DistinctId::Fn` - pinned-or-derived dev distinct id.
21//! - `CaptureAllowed::Fn` - `debug_assertions` && `Report != off`.
22
23pub mod CaptureError;
24pub mod CaptureEvent;
25pub mod CaptureIPC;
26pub mod Initialize;
27
28pub(crate) mod CaptureAllowed;
29pub(crate) mod Client;
30pub(crate) mod Constants;
31pub(crate) mod DistinctId;