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: option to disable telemetry

Louis Beaumont9ab0899c14ce
diff --git a/screenpipe-app-tauri/components/settings.tsx b/screenpipe-app-tauri/components/settings.tsx
index 7be6f0aea..bb19f7932 100644
--- a/screenpipe-app-tauri/components/settings.tsx
+++ b/screenpipe-app-tauri/components/settings.tsx
@@ -25,7 +25,9 @@ import { Slider } from "@/components/ui/slider"; // Add this import
import { Eye, EyeOff, HelpCircle, RefreshCw, Settings2 } from "lucide-react";
import { RecordingSettings } from "./recording-settings";
-
+import { Switch } from "./ui/switch";
+import * as Sentry from "@sentry/react";
+import posthog from "posthog-js";
export function Settings({ className }: { className?: string }) {
const { settings, updateSettings, resetSetting } = useSettings();
const [localSettings, setLocalSettings] = React.useState(settings);
@@ -75,18 +77,39 @@ export function Settings({ className }: { className?: string }) {
updateSettings({ aiMaxContextChars: newValue });
};
+ const handleAnalyticsToggle = (checked: boolean) => {
+ const newValue = checked;
+ setLocalSettings({ ...localSettings, analyticsEnabled: newValue });
+ updateSettings({ analyticsEnabled: newValue });
+
+ if (!newValue) {
+ posthog.capture("telemetry", {
+ enabled: false,
+ });
+ Sentry.init({
+ enabled: false,
+ dsn: "https://cf682877173997afc8463e5ca2fbe3c7@o4507617161314304.ingest.us.sentry.io/4507617170161664",
+ });
+ Sentry.close();
+ posthog.opt_out_capturing();
+ } else {
+ posthog.opt_in_capturing();
+ posthog.capture("telemetry", {
+ enabled: true,
+ });
+ Sentry.init({
+ enabled: true,
+ dsn: "https://cf682877173997afc8463e5ca2fbe3c7@o4507617161314304.ingest.us.sentry.io/4507617170161664",
+ });
+ }
+ };
+
React.useEffect(() => {
setLocalSettings(settings);
}, [settings]);
return (
- <Dialog
- // onOpenChange={(open) => {
- // if (!open) {
- // location.reload(); // ! HACK to properly refresh stuff (tood beter)
- // }
- // }}
- >
+ <Dialog>
<DialogTrigger asChild>
<Button variant="ghost" className={className}>
<Settings2 className="mr-2 h-4 w-4" />
@@ -350,6 +373,39 @@ export function Settings({ className }: { className?: string }) {
</p>
</CardContent>
</Card>
+
+ <Card>
+ <CardHeader>
+ <CardTitle className="text-center">privacy settings</CardTitle>
+ </CardHeader>
+ <CardContent className="flex flex-col items-center space-y-4">
+ <div className="flex items-center space-x-2">
+ <Switch
+ id="analytics-toggle"
+ checked={localSettings.analyticsEnabled}
+ onCheckedChange={handleAnalyticsToggle}
+ />
+ <Label htmlFor="analytics-toggle">enable telemetry</Label>
+ </div>
+ <p className="text-sm text-muted-foreground text-center">
+ telemetry helps us improve screenpipe.
+ <br />
+ when enabled, we collect anonymous usage data such as button
+ clicks.
+ <br />
+ we do not collect any screen data, microphone, query data. read
+ more on our data privacy policy{" "}
+ <a
+ href="https://screenpi.pe/privacy"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="text-primary hover:underline"
+ >
+ here
+ </a>
+ </p>
+ </CardContent>
+ </Card>
</div>
</DialogContent>
</Dialog>
diff --git a/screenpipe-app-tauri/lib/hooks/use-settings.tsx b/screenpipe-app-tauri/lib/hooks/use-settings.tsx
index 8ca0e3285..16ba7866d 100644
--- a/screenpipe-app-tauri/lib/hooks/use-settings.tsx
+++ b/screenpipe-app-tauri/lib/hooks/use-settings.tsx
@@ -38,6 +38,7 @@ const defaultSettings: Settings = {
aiMaxContextChars: 30000,
fps: 0.5,
vadSensitivity: "high",
+ analyticsEnabled: true,
};
export type VadSensitivity = "low" | "medium" | "high";
@@ -67,6 +68,7 @@ export interface Settings {
aiMaxContextChars: number;
fps: number;
vadSensitivity: VadSensitivity;
+ analyticsEnabled: boolean;
}
let store: Store | null = null;
@@ -162,6 +164,8 @@ export function useSettings() {
(platform() === "macos" ? 0.2 : 1);
const savedVadSensitivity =
((await store!.get("vadSensitivity")) as VadSensitivity) || "high";
+ const savedAnalyticsEnabled =
+ ((await store!.get("analyticsEnabled")) as boolean) || true;
setSettings({
openaiApiKey: savedKey,
deepgramApiKey: savedDeepgramKey,
@@ -188,6 +192,7 @@ export function useSettings() {
aiMaxContextChars: savedAiMaxContextChars,
fps: savedFps,
vadSensitivity: savedVadSensitivity,
+ analyticsEnabled: savedAnalyticsEnabled,
});
} catch (error) {
console.error("Failed to load settings:", error);
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.toml
index 24934139c..766c56aa9 100644
--- a/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "0.2.81"
+version = "0.2.82"
description = ""
authors = ["you"]
license = ""