import posthog from "posthog-js"; const shouldIgnore = typeof document !== "undefined" && document.cookie.includes("thesvg_ignore_analytics=true"); const posthogKey = process.env.NEXT_PUBLIC_POSTHOG_KEY; if (posthogKey) { posthog.init(posthogKey, { api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST || "https://us.i.posthog.com", ui_host: "https://us.posthog.com", defaults: "2026-01-30", capture_exceptions: !shouldIgnore, debug: process.env.NODE_ENV === "development", }); if (shouldIgnore) { posthog.opt_out_capturing(); } }