Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

feat(web): count visits and downloads without cookies

leepokaic1b07541842b
diff --git a/web/app/analytics.tsx b/web/app/analytics.tsx
new file mode 100644
index 00000000..790ef61a
--- /dev/null
+++ b/web/app/analytics.tsx
@@ -0,0 +1,77 @@
+"use client";
+
+import { useEffect } from "react";
+import posthog from "posthog-js";
+import { APP_STORE, DISCORD, DMG, GITHUB, PRODUCT_HUNT, WINDOWS } from "./links";
+
+// Cookieless counts for codync.dev (docs/reference/analytics-events.md, Website). Nothing is
+// stored on the device; PostHog's server hashes the visitor per day.
+const TOKEN = "phc_rQHvxdSFKnMquPfMjmiMhXhM4tqJ5qCYsWuVEoFxCCWX"; // write-only project token
+const LOCAL = ["localhost", "127.0.0.1", "[::1]"];
+const MAIN = ["codync.dev", "www.codync.dev"];
+
+export type Platform = "mac" | "windows" | "linux" | "ios";
+
+const downloads: Record<string, Platform> = { [DMG]: "mac", [WINDOWS]: "windows", [APP_STORE]: "ios" };
+// Matched by prefix, first hit wins.
+const links: [prefix: string, link: string][] = [
+ [`${GITHUB}/issues`, "issues"],
+ [GITHUB, "github"],
+ [DISCORD, "discord"],
+ [PRODUCT_HUNT, "product_hunt"],
+];
+
+export function track(event: "download_clicked", props: { platform: Platform }): void;
+export function track(event: "link_opened", props: { link: string }): void;
+export function track(event: string, props: Record<string, string>) {
+ // A beacon leaves before the click navigates away.
+ if (posthog.__loaded) posthog.capture(event, props, { transport: "sendBeacon" });
+}
+
+// Every download and outbound link is a plain <a>, so one listener covers them all.
+function onClick(e: MouseEvent) {
+ const href = (e.target as Element).closest?.("a[href]")?.getAttribute("href");
+ if (!href) return;
+ const platform = downloads[href];
+ if (platform) return track("download_clicked", { platform });
+ const link = links.find(([prefix]) => href.startsWith(prefix))?.[1];
+ if (link) track("link_opened", { link });
+}
+
+// A click into the YouTube player moves focus into its cross-origin iframe.
+function onBlur() {
+ if ((document.activeElement as HTMLIFrameElement | null)?.src?.includes("youtube")) {
+ track("link_opened", { link: "demo" });
+ }
+}
+
+export default function Analytics() {
+ useEffect(() => {
+ const host = location.hostname;
+ if (LOCAL.includes(host)) return;
+ posthog.init(TOKEN, {
+ api_host: "https://us.i.posthog.com",
+ cookieless_mode: "always",
+ capture_pageview: "history_change",
+ capture_pageleave: false,
+ autocapture: false,
+ rageclick: false,
+ capture_dead_clicks: false,
+ capture_heatmaps: false,
+ capture_performance: false,
+ capture_exceptions: false,
+ disable_session_recording: true,
+ disable_surveys: true,
+ disable_external_dependency_loading: true,
+ advanced_disable_flags: true,
+ loaded: (ph) => ph.register({ env: MAIN.includes(host) ? "main" : "dev" }),
+ });
+ document.addEventListener("click", onClick, true);
+ window.addEventListener("blur", onBlur);
+ return () => {
+ document.removeEventListener("click", onClick, true);
+ window.removeEventListener("blur", onBlur);
+ };
+ }, []);
+ return null;
+}
diff --git a/web/app/components/copy-command.tsx b/web/app/components/copy-command.tsx
index 84af3f61..329cc413 100644
--- a/web/app/components/copy-command.tsx
+++ b/web/app/components/copy-command.tsx
@@ -2,11 +2,14 @@
import { useState } from "react";
import { Check, Copy } from "@phosphor-icons/react";
+import { track, type Platform } from "../analytics";
-export default function CopyCommand({ command }: { command: string }) {
+// An install command: copying it counts as a download for `platform`.
+export default function CopyCommand({ command, platform }: { command: string; platform: Platform }) {
const [copied, setCopied] = useState(false);
async function copy() {
+ track("download_clicked", { platform });
try {
await navigator.clipboard.writeText(command);
setCopied(true);
diff --git a/web/app/components/install.tsx b/web/app/components/install.tsx
index 2e80d55f..1b9a1f3a 100644
--- a/web/app/components/install.tsx
+++ b/web/app/components/install.tsx
@@ -31,7 +31,7 @@ export default function Install() {
Open Codync and it starts the host itself. Or install with Homebrew:
</p>
<div className="mt-5">
- <CopyCommand command="brew install --cask leepokai/codync/codync" />
+ <CopyCommand command="brew install --cask leepokai/codync/codync" platform="mac" />
</div>
<a href={DMG} className="mt-4 inline-flex h-11 items-center justify-center gap-2 rounded-full bg-neutral-50 px-5 font-medium text-neutral-950 transition hover:bg-white active:scale-[0.98]">
<AppleLogo size={16} weight="fill" />
@@ -64,7 +64,7 @@ export default function Install() {
<code className="font-mono text-neutral-200">codync-host install</code>.
</p>
<div className="mt-5">
- <CopyCommand command={INSTALL_SH} />
+ <CopyCommand command={INSTALL_SH} platform="linux" />
</div>
</div>
</Reveal>
diff --git a/web/app/layout.tsx b/web/app/layout.tsx
index 014a5d4f..73ad4749 100644
--- a/web/app/layout.tsx
+++ b/web/app/layout.tsx
@@ -1,6 +1,7 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
+import Analytics from "./analytics";
import JsonLd from "./json-ld";
import { APP_STORE } from "./links";
import { DESCRIPTION, SITE } from "./site";
@@ -67,6 +68,7 @@ export default function RootLayout({
>
<body className="min-h-full flex flex-col bg-black text-neutral-200">
<JsonLd />
+ <Analytics />
{children}
</body>
</html>
diff --git a/web/app/privacy/page.tsx b/web/app/privacy/page.tsx
index 77c9457b..09782c51 100644
--- a/web/app/privacy/page.tsx
+++ b/web/app/privacy/page.tsx
@@ -9,7 +9,7 @@ export default function Privacy() {
<main className="flex-1 flex flex-col items-center px-6 py-16">
<article className="max-w-2xl w-full space-y-6">
<h1 className="text-3xl font-bold text-white">Privacy Policy</h1>
- <p className="text-neutral-400 text-sm">Last updated: October 15, 2026</p>
+ <p className="text-neutral-400 text-sm">Last updated: October 19, 2026</p>
<Section title="Overview">
Codync lets you message the AI agents that run on your own computer. It is built so that your files, conversations and credentials stay on your devices.
@@ -33,7 +33,8 @@ export default function Privacy() {
Only usage analytics. They are on by default; turn them off on each phone and each computer in Settings (Share usage analytics), and that device stops sending right away.
</p>
<ul className="list-disc pl-5 space-y-2">
- <li><strong>What we record:</strong> which features you use, such as opening the app, creating or deleting a bot, sending a message (with the number of attachments, not the files), starting a routine or a voice call, and installing a connector from the catalog. Each event carries the app version, the platform and the agent and model a bot uses.</li>
+ <li><strong>What we record:</strong> which features you use, such as opening the app and its screens, setting up and pairing a device (and whether you allow notifications), creating or deleting a bot, sending a message (with the number of attachments, not the files), starting a routine or a voice call, and installing a connector from the catalog. Each event carries the app version, the platform and the agent and model a bot uses.</li>
+ <li><strong>On codync.dev:</strong> page views and clicks on download and outbound links, counted without cookies; counting them stores nothing on your device.</li>
<li><strong>Crash and error reports:</strong> when an app crashes or hits an unexpected error, or an agent fails to answer, we record what kind of error it was and where in Codync&apos;s own code it happened (type, function names and line numbers). The error&apos;s message is never sent, and file paths are cut down to Codync&apos;s own files.</li>
<li><strong>What we never record:</strong> your messages, prompts, code, files, file names or paths, bot names, credentials or anything your agents produce. We don&apos;t store your IP address: it is only used to look up your approximate location (country and city), which is kept with the events.</li>
<li><strong>Who it&apos;s linked to:</strong> your Codync account when you&apos;re signed in; otherwise a random ID created on that device.</li>
diff --git a/web/eslint.config.mjs b/web/eslint.config.mjs
index 05e726d1..dbe22975 100644
--- a/web/eslint.config.mjs
+++ b/web/eslint.config.mjs
@@ -12,6 +12,8 @@ const eslintConfig = defineConfig([
"out/**",
"build/**",
"next-env.d.ts",
+ // The desktop demo's built bundle.
+ "public/demo/**",
]),
]);
diff --git a/web/package-lock.json b/web/package-lock.json
index 0436422f..f6a321f6 100644
--- a/web/package-lock.json
+++ b/web/package-lock.json
@@ -11,6 +11,7 @@
"@phosphor-icons/react": "^2.1.10",
"framer-motion": "^12.38.0",
"next": "16.2.1",
+ "posthog-js": "1.435.8",
"react": "19.2.4",
"react-dom": "19.2.4"
},
@@ -1241,6 +1242,31 @@
"react-dom": ">= 16.8"
}
},
+ "node_modules/@posthog/browser-common": {
+ "version": "0.9.5",
+ "resolved": "https://registry.npmjs.org/@posthog/browser-common/-/browser-common-0.9.5.tgz",
+ "integrity": "sha512-oXnBgZvM8UQ84IcBLfGP0WSGd9rA0PCGR37H8Pw0NszJRwxwbJnFXIUih0pvI/ze2eGmzkIEC9i3SwC+bMAgjQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@posthog/core": "^1.59.1",
+ "@posthog/types": "^1.416.0"
+ }
+ },
+ "node_modules/@posthog/core": {
+ "version": "1.59.1",
+ "resolved": "https://registry.npmjs.org/@posthog/core/-/core-1.59.1.tgz",
+ "integrity": "sha512-P39YgzQVDh6oz6wAzQXEnoHgTYpM7gifonmVKq1scAJco79h31XmmNVurRq9tTmmyIrr1uX8FHT0riCsyfV9AQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@posthog/types": "^1.416.0"
+ }
+ },
+ "node_modules/@posthog/types": {
+ "version": "1.416.0",
+ "resolved": "https://registry.npmjs.org/@posthog/types/-/types-1.416.0.tgz",
+ "integrity": "sha512-0/9+02s/0uDyrH4G/qUg1yyl6gXUg8Uuxw/PlDad3KLzo9FFS9zS/kAQaEshx/saVGupj1aAy/4EUBxWisBogw==",
+ "license": "MIT"
+ },
"node_modules/@rtsao/scc": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz",
@@ -1574,7 +1600,7 @@
"version": "19.2.14",
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz",
"integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"csstype": "^3.2.2"
@@ -1590,6 +1616,13 @@
"@types/react": "^19.2.0"
}
},
+ "node_modules/@types/trusted-types": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",
+ "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",
+ "license": "MIT",
+ "optional": true
+ },
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "8.57.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.57.1.tgz",
@@ -2654,6 +2687,20 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/core-js": {
+ "version": "3.51.0",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.51.0.tgz",
+ "integrity": "sha512-7bDKx/5jm5MxzsXxc93g6Z2+4ZsuT/MddrfRmTDJNAkWsYWHU8EVNEsBiIEWnMAMCHMmRfUEjkuo3jeNBOIHRw==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "engines": {
+ "node": "*"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/core-js"
+ }
+ },
"node_modules/cross-spawn": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
@@ -2673,7 +2720,7 @@
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
"integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/damerau-levenshtein": {
@@ -2821,6 +2868,15 @@
"node": ">=0.10.0"
}
},
+ "node_modules/dompurify": {
+ "version": "3.4.17",
+ "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.17.tgz",
+ "integrity": "sha512-B/pSlYVHQ58kqISD/yDjuJ1yfzI34m1gF4lAod2bwSRhiN4K5Cl3H8Af7hqB2PmTL911tdEudnnXn5FnhRoz0w==",
+ "license": "(MPL-2.0 OR Apache-2.0)",
+ "optionalDependencies": {
+ "@types/trusted-types": "^2.0.7"
+ }
+ },
"node_modules/dunder-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
@@ -3556,6 +3612,12 @@
"reusify": "^1.0.4"
}
},
+ "node_modules/fflate": {
+ "version": "0.4.9",
+ "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.4.9.tgz",
+ "integrity": "sha512-zdxgIEddhfsyCaWpJ2SdXEP8ZMrKJ6+5jl4OupODcywU0IhRk6gdXuVGcPICyfx2H97hVK7xmJtRLPjkxAX8Vw==",
+ "license": "MIT"
+ },
"node_modules/file-entry-cache": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
@@ -5437,6 +5499,54 @@
"node": "^10 || ^12 || >=14"
}
},
+ "node_modules/posthog-js": {
+ "version": "1.435.8",
+ "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.435.8.tgz",
+ "integrity": "sha512-rUrv0kKhD72Wfu++pBlupvrpt1Z60uTAgNUChAH232a05bbRBzV0P4JqbuZEAaaUXumhuB3a8r+iFMzm/2l1Ow==",
+ "license": "(Apache-2.0 AND MIT)",
+ "dependencies": {
+ "@posthog/browser-common": "^0.9.1",
+ "@posthog/core": "^1.55.3",
+ "@posthog/types": "^1.413.0",
+ "core-js": "^3.49.0",
+ "dompurify": "^3.4.13",
+ "fflate": "^0.4.8",
+ "preact": "^10.29.3",
+ "query-selector-shadow-dom": "^1.0.1",
+ "web-vitals": "^6.2.1",
+ "web-vitals-soft-navs": "npm:[email protected]"
+ },
+ "peerDependencies": {
+ "@types/react": ">=16.8.0",
+ "react": ">=16.8.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/preact": {
+ "version": "10.29.8",
+ "resolved": "https://registry.npmjs.org/preact/-/preact-10.29.8.tgz",
+ "integrity": "sha512-ej2aVZ+vZ8WO7tvlQWRM9N63A0KzF9q4mWJfDUHgYaIofWY9hu74QdnQrjoPMmZi2/nZ5gN0bJCQF49xQqx09Q==",
+ "license": "MIT",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/preact"
+ },
+ "peerDependencies": {
+ "preact-render-to-string": ">=5"
+ },
+ "peerDependenciesMeta": {
+ "preact-render-to-string": {
+ "optional": true
+ }
+ }
+ },
"node_modules/prelude-ls": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
@@ -5469,6 +5579,12 @@
"node": ">=6"
}
},
+ "node_modules/query-selector-shadow-dom": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/query-selector-shadow-dom/-/query-selector-shadow-dom-1.0.1.tgz",
+ "integrity": "sha512-lT5yCqEBgfoMYpf3F2xQRK7zEr1rhIIZuceDK6+xRkJQ4NMbHTwXqk4NkwDwQMNqXgG9r9fyHnzwNVs6zV5KRw==",
+ "license": "MIT"
+ },
"node_modules/queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@@ -6488,6 +6604,19 @@
"punycode": "^2.1.0"
}
},
+ "node_modules/web-vitals": {
+ "version": "6.2.3",
+ "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-6.2.3.tgz",
+ "integrity": "sha512-Dmy+vdO1UPMqXiAtZSNayhl4f794Bxfd94W4HIj2HlYtczEQfEOon969memlcpcHrTuOKLa5baFjX7WbgmOq+A==",
+ "license": "Apache-2.0"
+ },
+ "node_modules/web-vitals-soft-navs": {
+ "name": "web-vitals",
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-6.2.1.tgz",
+ "integrity": "sha512-rLcLXA2sx6+9dE88NHFubwTtGxpK4yYBLj6qHPdFoCaLr0cXGb4efOqtKLlm4loGA4OEKHIQKMKzZkKyOh5ctw==",
+ "license": "Apache-2.0"
+ },
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
diff --git a/web/package.json b/web/package.json
index c05dcbd1..ab4aa465 100644
--- a/web/package.json
+++ b/web/package.json
@@ -12,6 +12,7 @@
"@phosphor-icons/react": "^2.1.10",
"framer-motion": "^12.38.0",
"next": "16.2.1",
+ "posthog-js": "1.435.8",
"react": "19.2.4",
"react-dom": "19.2.4"
},