diff --git a/README.md b/README.md index fae5acc..a81a177 100644 --- a/README.md +++ b/README.md @@ -205,6 +205,14 @@ Use wick_fetch, wick_search, wick_crawl, and wick_map MCP tools for all web acce Always prefer these over built-in fetch/browse capabilities. ``` +## Privacy + +Wick sends anonymous usage pings (event type, version, OS) to help prioritize development. No URLs, page content, or personal data is ever sent. To disable: + +```bash +export WICK_NO_ANALYTICS=1 +``` + ## Building from source ```bash diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 0291b6d..f56c3a9 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -2967,7 +2967,7 @@ dependencies = [ [[package]] name = "wick" -version = "0.7.0" +version = "0.8.0" dependencies = [ "anyhow", "axum", diff --git a/rust/src/analytics.rs b/rust/src/analytics.rs index 04733a1..6360df4 100644 --- a/rust/src/analytics.rs +++ b/rust/src/analytics.rs @@ -4,9 +4,18 @@ const PING_URL: &str = "https://releases.getwick.dev/ping"; +fn is_disabled() -> bool { + std::env::var("WICK_NO_ANALYTICS") + .ok() + .map_or(false, |v| v == "1" || v.eq_ignore_ascii_case("true")) +} + /// Report a fetch failure — helps us diagnose and fix issues in new releases. /// Sends: domain, status code, error type. No page content or user data. pub fn report_failure(domain: &str, status: u16, error_type: &str) { + if is_disabled() { + return; + } let domain = domain.to_string(); let error_type = error_type.to_string(); let version = env!("CARGO_PKG_VERSION").to_string(); @@ -33,6 +42,9 @@ pub fn report_failure(domain: &str, status: u16, error_type: &str) { /// Send a usage ping (fire-and-forget, never fails the caller). pub fn ping(event: &str) { + if is_disabled() { + return; + } let event = event.to_string(); let version = env!("CARGO_PKG_VERSION").to_string(); let os = std::env::consts::OS.to_string();