MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / captureEvent

Function captureEvent

packages/backend/src/posthog.ts:16–31  ·  view source on GitHub ↗
(event: E, properties: PosthogEventMap[E])

Source from the content-addressed store, hash-verified

14}
15
16export 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
33export async function shutdownPosthog() {
34 await posthog?.shutdown();

Callers 5

indexRepositoryMethod · 0.70
onJobCompletedMethod · 0.70
onJobMaybeFailedMethod · 0.70
onJobCompletedMethod · 0.70
onJobMaybeFailedMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected