Files
prowler/ui/lib/posthog.ts
T
Amit Sharma 8a65efa441 feat: add PostHog analytics integration
- Add PostHog client configuration in ui/lib/posthog.ts
- Integrate PostHog tracking in auth forms and provider workflows
- Add PostHog dependencies (posthog-js and posthog-node)
- Update Next.js config for PostHog integration
- Add environment variables for PostHog configuration
- Update changelog with PostHog integration entry
2025-07-23 15:08:21 -07:00

12 lines
382 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;
}