mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-25 17:54:34 +08:00
feat(analytics): add privacy-safe product telemetry
Add self-hosted Umami reporting alongside existing telemetry across Desktop and CLI Web. Track normalized startup, import, feature, and AI usage with a stable anonymous ID and strict privacy allowlists. Keep incremental usage platform-independent and preserve accurate failure classifications and platform metadata across import paths.
This commit is contained in:
1 parent
db60339829
commit
860bf52d62
48 files changed
+1615
-162
No files matched your search
@@ -10,6 +10,7 @@ import type { ImportProgress } from '../../../../src/types/base'
|
||||
interface ChatImportResult {
|
||||
success: boolean
|
||||
sessionId?: string
|
||||
platform?: string
|
||||
error?: string
|
||||
importMode?: 'created' | 'incremental'
|
||||
matchedBy?: 'source-session-id' | 'stable-id' | 'trailing-messages'
|
||||
@@ -90,6 +91,7 @@ export const chatApi = {
|
||||
newMessageCount: number
|
||||
duplicateCount: number
|
||||
totalInFile: number
|
||||
platform?: string
|
||||
error?: string
|
||||
diagnosis?: { suggestion?: string }
|
||||
}> => ipcRenderer.invoke('chat:analyzeIncrementalImport', sessionId, filePath),
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* 核心 API - 基础 IPC 通信和系统功能
|
||||
*/
|
||||
import { ipcRenderer } from 'electron'
|
||||
import type { AnalyticsEventName } from '@openchatlab/shared-types'
|
||||
|
||||
// Custom APIs for renderer
|
||||
export const api = {
|
||||
@@ -95,6 +96,9 @@ export const extendedApi = {
|
||||
trackDailyActive: (locale: string): Promise<void> => {
|
||||
return ipcRenderer.invoke('analytics:trackDailyActive', locale)
|
||||
},
|
||||
trackAnalyticsEvent: (eventName: AnalyticsEventName, properties?: Record<string, unknown>): Promise<void> => {
|
||||
return ipcRenderer.invoke('analytics:track', eventName, properties)
|
||||
},
|
||||
/**
|
||||
* 重启应用
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user