Files
monie-web/src/integrations/posthog/provider.tsx
T
denis 691c6f574f
Deploy monie-web to prod (kaniko) / build-and-deploy (push) Successful in 12m10s
chore: initialize project
2026-04-12 16:27:24 +03:00

21 lines
671 B
TypeScript

import posthog from 'posthog-js'
import { PostHogProvider as BasePostHogProvider } from '@posthog/react'
import type { ReactNode } from 'react'
if (typeof window !== 'undefined' && import.meta.env.VITE_POSTHOG_KEY) {
posthog.init(import.meta.env.VITE_POSTHOG_KEY, {
api_host: import.meta.env.VITE_POSTHOG_HOST || 'https://us.i.posthog.com',
person_profiles: 'identified_only',
capture_pageview: false,
defaults: '2025-11-30',
})
}
interface PostHogProviderProps {
children: ReactNode
}
export default function PostHogProvider({ children }: PostHogProviderProps) {
return <BasePostHogProvider client={posthog}>{children}</BasePostHogProvider>
}