Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

feat: unified screenpipe_id across Sentry, PostHog, and feedback

Louis Beaumont60cfd250f9d9
diff --git a/Cargo.lock b/Cargo.lock
index e940d1e5c..8751b1515 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6628,7 +6628,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.44"
+version = "0.3.45"
dependencies = [
"anyhow",
"bytemuck",
@@ -6681,7 +6681,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.44"
+version = "0.3.45"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -6732,7 +6732,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.44"
+version = "0.3.45"
dependencies = [
"anyhow",
"chrono",
@@ -6756,7 +6756,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.44"
+version = "0.3.45"
dependencies = [
"anyhow",
"chrono",
@@ -6774,7 +6774,7 @@ dependencies = [
[[package]]
name = "screenpipe-integrations"
-version = "0.3.44"
+version = "0.3.45"
dependencies = [
"anyhow",
"image",
@@ -6789,7 +6789,7 @@ dependencies = [
[[package]]
name = "screenpipe-server"
-version = "0.3.44"
+version = "0.3.45"
dependencies = [
"anyhow",
"async-trait",
@@ -6858,7 +6858,7 @@ dependencies = [
[[package]]
name = "screenpipe-vision"
-version = "0.3.44"
+version = "0.3.45"
dependencies = [
"accessibility-sys",
"anyhow",
diff --git a/apps/screenpipe-app-tauri/components/share-logs-button.tsx b/apps/screenpipe-app-tauri/components/share-logs-button.tsx
index 95b23fae7..392ad1465 100644
--- a/apps/screenpipe-app-tauri/components/share-logs-button.tsx
+++ b/apps/screenpipe-app-tauri/components/share-logs-button.tsx
@@ -289,6 +289,7 @@ export const ShareLogsButton = ({
feedback_text: feedbackText,
screenshot_url: screenshotPath,
video_url: videoPath,
+ screenpipe_id: settings.analyticsId,
}),
});
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index b797c0540..2ec677467 100755
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -9007,7 +9007,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.0.250"
+version = "2.0.251"
dependencies = [
"anyhow",
"async-stream",
@@ -9089,7 +9089,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.44"
+version = "0.3.45"
dependencies = [
"anyhow",
"bytemuck",
@@ -9137,7 +9137,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.44"
+version = "0.3.45"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -9188,7 +9188,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.44"
+version = "0.3.45"
dependencies = [
"anyhow",
"chrono",
@@ -9212,7 +9212,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.44"
+version = "0.3.45"
dependencies = [
"anyhow",
"chrono",
@@ -9228,7 +9228,7 @@ dependencies = [
[[package]]
name = "screenpipe-integrations"
-version = "0.3.44"
+version = "0.3.45"
dependencies = [
"anyhow",
"image 0.25.9",
@@ -9243,7 +9243,7 @@ dependencies = [
[[package]]
name = "screenpipe-server"
-version = "0.3.44"
+version = "0.3.45"
dependencies = [
"anyhow",
"async-trait",
@@ -9307,7 +9307,7 @@ dependencies = [
[[package]]
name = "screenpipe-vision"
-version = "0.3.44"
+version = "0.3.45"
dependencies = [
"accessibility-sys",
"anyhow",
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/embedded_server.rs b/apps/screenpipe-app-tauri/src-tauri/src/embedded_server.rs
index 9b8bf795e..d68856684 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/embedded_server.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/embedded_server.rs
@@ -46,6 +46,7 @@ pub struct EmbeddedServerConfig {
pub deepgram_api_key: Option<String>,
pub enable_frame_cache: bool,
pub analytics_enabled: bool,
+ pub analytics_id: String,
pub enable_ui_events: bool,
pub use_all_monitors: bool,
pub use_chinese_mirror: bool,
@@ -87,6 +88,7 @@ impl EmbeddedServerConfig {
},
enable_frame_cache: store.enable_frame_cache,
analytics_enabled: store.analytics_enabled,
+ analytics_id: store.analytics_id.clone(),
enable_ui_events: store.enable_ui_events,
use_all_monitors: store.use_all_monitors,
use_chinese_mirror: store.use_chinese_mirror,
@@ -205,6 +207,12 @@ pub async fn start_embedded_server(
// Set environment variables for compatibility with CLI behavior
// File descriptor limit to prevent "Too many open files" errors
std::env::set_var("SCREENPIPE_FD_LIMIT", "8192");
+
+ // Pass analytics ID so the embedded server's PostHog events use the same distinct_id
+ // as the Tauri app frontend, linking CLI and app analytics to the same user
+ if !config.analytics_id.is_empty() {
+ std::env::set_var("SCREENPIPE_ANALYTICS_ID", &config.analytics_id);
+ }
// Chinese HuggingFace mirror
if config.use_chinese_mirror {
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/main.rs b/apps/screenpipe-app-tauri/src-tauri/src/main.rs
index ff8c4df67..2cd79fe1d 100755
--- a/apps/screenpipe-app-tauri/src-tauri/src/main.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/main.rs
@@ -1137,6 +1137,12 @@ async fn main() {
// Attach non-sensitive settings to all future Sentry events
if !telemetry_disabled {
sentry::configure_scope(|scope| {
+ // Set user.id to the persistent analytics UUID
+ // This links Sentry errors to PostHog sessions and feedback reports
+ scope.set_user(Some(sentry::protocol::User {
+ id: Some(store.analytics_id.clone()),
+ ..Default::default()
+ }));
scope.set_context("app_settings", sentry::protocol::Context::Other({
let mut map = std::collections::BTreeMap::new();
map.insert("fps".into(), serde_json::json!(store.fps));
diff --git a/crates/screenpipe-server/src/bin/screenpipe-server.rs b/crates/screenpipe-server/src/bin/screenpipe-server.rs
index b70ad393a..bbee9c82a 100644
--- a/crates/screenpipe-server/src/bin/screenpipe-server.rs
+++ b/crates/screenpipe-server/src/bin/screenpipe-server.rs
@@ -288,6 +288,12 @@ async fn main() -> anyhow::Result<()> {
// Attach non-sensitive CLI settings to all future Sentry events
sentry::configure_scope(|scope| {
+ // Set user.id to the same analytics ID used by PostHog
+ // This links Sentry errors to PostHog sessions and feedback reports
+ scope.set_user(Some(sentry::protocol::User {
+ id: Some(analytics::get_distinct_id().to_string()),
+ ..Default::default()
+ }));
scope.set_context("cli_settings", sentry::protocol::Context::Other({
let mut map = std::collections::BTreeMap::new();
map.insert("fps".into(), json!(cli.fps));