import { invoke } from "@tauri-apps/api/core"; export type AnalyticsEventProperties = Record; export function trackAnalyticsEvent(name: string, props?: AnalyticsEventProperties) { void invoke("plugin:aptabase|track_event", { name, props: props && Object.keys(props).length > 0 ? props : undefined, }).catch(() => { // Analytics must never interrupt the Git workflow. }); }