mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 21:11:53 +00:00
bc34c9df4a
- Create lib/analytics.ts with centralized tracking functions - Use arrow functions and camelCase naming per code standards - Add error handling to prevent analytics failures from crashing app - Update auth forms and provider workflows to use new analytics lib - Export TypeScript interfaces for type-safe analytics payloads Addresses PR review comments: - Convert to arrow functions (requested by @paabloLC) - Use camelCase for event and property names - Centralize analytics logic for better maintainability
14 lines
402 B
TypeScript
14 lines
402 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.
|
|
const PostHogClient = () => {
|
|
const posthogClient = new PostHog(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {
|
|
host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
|
|
flushAt: 1,
|
|
flushInterval: 0,
|
|
});
|
|
return posthogClient;
|
|
};
|
|
|
|
export default PostHogClient;
|