/** * folk-analytics-view — Privacy-first analytics dashboard overview. * * Shows tracked apps, stats, and a link to the full Umami dashboard. */ class FolkAnalyticsView extends HTMLElement { private shadow: ShadowRoot; private space = "demo"; private stats: any = null; constructor() { super(); this.shadow = this.attachShadow({ mode: "open" }); } connectedCallback() { this.space = this.getAttribute("space") || "demo"; this.loadStats(); } private async loadStats() { try { const base = window.location.pathname.replace(/\/$/, ""); const resp = await fetch(`${base}/api/stats`); if (resp.ok) { this.stats = await resp.json(); } } catch { /* ignore */ } this.render(); } private render() { const stats = this.stats || { trackedApps: 17, cookiesSet: 0, scriptSize: "~2KB", selfHosted: true, apps: [], dashboardUrl: "https://analytics.rspace.online" }; this.shadow.innerHTML = `

Privacy-First Analytics

Zero-knowledge, cookieless, self-hosted analytics for the r* ecosystem. Know how your tools are used without compromising anyone's privacy.

${stats.trackedApps}
Apps Tracked
${stats.cookiesSet}
Cookies Set
${stats.scriptSize}
Script Size
100%
Self-Hosted
ZK

Zero-Knowledge Privacy

No cookies. No fingerprinting. No personal data. Each page view is anonymous. GDPR compliant by architecture.

LF

Local-First Data

Analytics data never leaves your infrastructure. No third-party servers, no cloud dependencies.

SH

Self-Hosted

Full control over data retention, access, and lifecycle. Powered by Umami.

Tracking the r* Ecosystem
${(stats.apps || []).map((a: string) => `${a}`).join("")}
Open Dashboard
`; } } customElements.define("folk-analytics-view", FolkAnalyticsView);