espace-paie-odentas/lib/posthog.ts
2025-10-13 23:46:54 +02:00

11 lines
379 B
TypeScript

import { PostHog } from "posthog-node"
// NOTE: This is a Node.js client, so you can use it for sending events from the server side to PostHog.
export default function PostHogClient() {
const posthogClient = new PostHog(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {
host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
flushAt: 1,
flushInterval: 0,
})
return posthogClient
}