Skip to main content

Mountain/Binary/Build/
PostHogPlugin.rs

1
2//! # PostHog Plugin
3//!
4//! Debug-only PostHog analytics integration. Captures lifecycle events,
5//! IPC commands, and errors during dev runs; compile-time gated to
6//! `cfg(debug_assertions)` so release builds drop the entire stack.
7//!
8//! Layout (one export per file, file name = identity):
9//! - `Initialize::Fn` - boot the global ingestion client.
10//! - `CaptureEvent::Fn` - generic event emitter with `$app` / `$component`
11//!   standard props.
12//! - `CaptureError::Fn` - emit under `land:mountain:error` with tag + message.
13//! - `CaptureIPC::Fn` - emit under `land:mountain:ipc:invoke` with method name.
14//! - `CaptureHandler::Fn` - emit under `land:mountain:handler:complete` with
15//!   `feature` + `duration_ms` + `ok`. Powers the Feature Parity dashboard's
16//!   Node-vs-Rust handler latency comparison.
17//!
18//! Module-private helpers:
19//! - `Constants` - `Authorize` / `Beam` / `Report` / `Brand` baked from
20//!   `.env.Land.PostHog`.
21//! - `Client::CLIENT` - `OnceLock<posthog_rs::Client>` singleton.
22//! - `DistinctId::Fn` - pinned-or-derived dev distinct id.
23//! - `CaptureAllowed::Fn` - `debug_assertions` && `Report != off`.
24
25pub mod CaptureError;
26
27pub mod CaptureEvent;
28
29pub mod CaptureHandler;
30
31pub mod CaptureIPC;
32
33pub mod HydrateRuntimeEnvironment;
34
35pub mod Initialize;
36
37pub(crate) mod CaptureAllowed;
38
39pub(crate) mod Client;
40
41pub(crate) mod Constants;
42
43pub(crate) mod DistinctId;