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
