MCPcopy Create free account
hub / github.com/winfunc/opcode / initialize

Method initialize

src/lib/analytics/index.ts:46–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44 }
45
46 async initialize(): Promise<void> {
47 if (this.initialized) return;
48
49 try {
50 // Initialize consent manager
51 const settings = await this.consentManager.initialize();
52
53 // Only initialize PostHog if user has consented
54 if (settings.hasConsented && settings.enabled) {
55 this.initializePostHog(settings);
56 }
57
58 // Start event queue flush interval
59 this.startFlushInterval();
60
61 this.initialized = true;
62 } catch (error) {
63 console.error('Failed to initialize analytics:', error);
64 }
65 }
66
67 private initializePostHog(settings: AnalyticsSettings): void {
68 try {

Callers

nothing calls this directly

Calls 2

initializePostHogMethod · 0.95
startFlushIntervalMethod · 0.95

Tested by

no test coverage detected