import posthog from 'posthog-js'

export function initPostHog() {
  if (typeof window !== 'undefined' && !posthog.__loaded) {
    posthog.init('phc_BHgg9S7CQqVShe7EMCdi86PxA49qcNaTsR9Nn5EGxRCT', {
      api_host: 'https://analytics.hyggecraftery.com',
      capture_pageview: false,
      persistence: 'localStorage',
    })
  }
}

export { posthog }
