···11+import posthog from 'posthog-js';
22+33+/**
44+ * Check if analytics should be captured
55+ * Centralizes the logic for when to track events
66+ */
77+export function shouldCaptureAnalytics(): boolean {
88+ return (
99+ process.env.NEXT_PUBLIC_VERCEL_ENV === 'production' && posthog.__loaded
1010+ );
1111+}