codeflash-internal/js/cf-api/analytics.ts
HeshamHM28 45e22e0f94
Cf-api Refactor (#2131)
Fixes CF-833
2026-01-19 23:03:57 +05:30

10 lines
318 B
TypeScript

import { PostHog } from "posthog-node"
import { POSTHOG_API_KEY, POSTHOG_HOST } from "./constants/index.js"
const isProduction = process.env.NODE_ENV === "production"
export const posthog = isProduction
? new PostHog(process.env.POSTHOG_API_KEY || POSTHOG_API_KEY, {
host: POSTHOG_HOST,
})
: undefined