(event: E, properties: PosthogEventMap[E])
| 14 | } |
| 15 | |
| 16 | export function captureEvent<E extends PosthogEvent>(event: E, properties: PosthogEventMap[E]) { |
| 17 | if (env.SOURCEBOT_TELEMETRY_DISABLED === 'true') { |
| 18 | return; |
| 19 | } |
| 20 | |
| 21 | posthog?.capture({ |
| 22 | distinctId: env.SOURCEBOT_INSTALL_ID, |
| 23 | event: event, |
| 24 | properties: { |
| 25 | ...properties, |
| 26 | sourcebot_version: SOURCEBOT_VERSION, |
| 27 | install_id: env.SOURCEBOT_INSTALL_ID, |
| 28 | }, |
| 29 | groups: { company: env.SOURCEBOT_INSTALL_ID }, |
| 30 | }); |
| 31 | } |
| 32 | |
| 33 | export async function shutdownPosthog() { |
| 34 | await posthog?.shutdown(); |
no outgoing calls
no test coverage detected