()
| 164 | } |
| 165 | |
| 166 | export async function flushAnalytics() { |
| 167 | if (!client) { |
| 168 | return |
| 169 | } |
| 170 | try { |
| 171 | await client.flush() |
| 172 | } catch (error) { |
| 173 | // Silently handle PostHog network errors - don't log to console or logger |
| 174 | // This prevents PostHog errors from cluttering the user's console |
| 175 | logAnalyticsError(error, { stage: AnalyticsErrorStage.Flush }) |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | export function trackEvent( |
| 180 | event: AnalyticsEvent, |
no test coverage detected