import { PostHog } from "posthog-node"

export default function PostHogClient(): PostHog | undefined {
  if (process.env.NODE_ENV !== "production") {
    return undefined
  }
  return new PostHog("phc_aUO790jHd7z1SXwsYCz8dRApxueplZlZWeDSpKc5hol", {
    host: "https://app.posthog.com",
    flushAt: 1,
    flushInterval: 0,
  })
}
