diff --git a/apps/dashboard/package.json b/apps/dashboard/package.json index 570533961..a163124a8 100644 --- a/apps/dashboard/package.json +++ b/apps/dashboard/package.json @@ -36,7 +36,7 @@ "lucide-react": "^0.378.0", "next": "15.2.3", "next-themes": "^0.2.1", - "posthog-js": "^1.234.9", + "posthog-js": "^1.235.0", "react": "19.0.0", "react-dom": "19.0.0", "react-globe.gl": "^2.28.2", @@ -57,9 +57,9 @@ "@types/react-dom": "19.0.4", "autoprefixer": "^10.4.17", "glob": "^10.4.1", + "import-in-the-middle": "^1.12.0", "postcss": "^8.4.38", "require-in-the-middle": "^7.4.0", - "import-in-the-middle": "^1.12.0", "rimraf": "^5.0.5", "tailwindcss": "^3.4.1", "tsx": "^4.7.2" diff --git a/apps/dashboard/src/app/providers.tsx b/apps/dashboard/src/app/providers.tsx index 02227c740..2d1610df2 100644 --- a/apps/dashboard/src/app/providers.tsx +++ b/apps/dashboard/src/app/providers.tsx @@ -5,24 +5,27 @@ import posthog from 'posthog-js'; import { PostHogProvider } from 'posthog-js/react'; import { Suspense, useEffect, useState } from 'react'; -if (typeof window !== 'undefined') { - const postHogKey = getPublicEnvVar('NEXT_PUBLIC_POSTHOG_KEY') ?? "phc_vIUFi0HzHo7oV26OsaZbUASqxvs8qOmap1UBYAutU4k"; - if (postHogKey.length > 5) { - posthog.init(postHogKey, { - session_recording: { - maskAllInputs: false, - maskInputOptions: { - password: true, - }, - }, - api_host: "/consume", - ui_host: "https://eu.i.posthog.com", - capture_pageview: false, - capture_pageleave: true, - }); - } -} export function CSPostHogProvider({ children }: { children: React.ReactNode }) { + useEffect(() => { + if (typeof window !== 'undefined') { + const postHogKey = getPublicEnvVar('NEXT_PUBLIC_POSTHOG_KEY') ?? "phc_vIUFi0HzHo7oV26OsaZbUASqxvs8qOmap1UBYAutU4k"; + if (postHogKey.length > 5) { + posthog.init(postHogKey, { + session_recording: { + maskAllInputs: false, + maskInputOptions: { + password: true, + }, + }, + api_host: "/consume", + ui_host: "https://eu.i.posthog.com", + capture_pageview: false, + capture_pageleave: true, + }); + } + } + }, []); + return {children}; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a144c0535..c1e5c81a3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -323,8 +323,8 @@ importers: specifier: ^0.2.1 version: 0.2.1(next@15.2.3(@babel/core@7.26.0)(@opentelemetry/api@1.9.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react-dom@19.0.0(react@19.0.0))(react@19.0.0) posthog-js: - specifier: ^1.234.9 - version: 1.234.9 + specifier: ^1.235.0 + version: 1.235.4 react: specifier: 19.0.0 version: 19.0.0 @@ -10129,8 +10129,8 @@ packages: resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==} engines: {node: '>=0.10.0'} - posthog-js@1.234.9: - resolution: {integrity: sha512-Qxpg9YOlLa59lbkYcONZ9efmB6KTgkePnkhCTSnKIyUd826cs4J6VDTKHu+V/lugRtWLWB9R7CckvFE8QPaTbg==} + posthog-js@1.235.4: + resolution: {integrity: sha512-CcAQpw7oaIoOwyaeqNZoKjciIMygrjgn6+cBSWFQcbo7aEmiO2666BZHZH/GBFmz0g2/w5abSpO7UntAj/69dw==} peerDependencies: '@rrweb/types': 2.0.0-alpha.17 rrweb-snapshot: 2.0.0-alpha.17 @@ -21599,7 +21599,7 @@ snapshots: dependencies: xtend: 4.0.2 - posthog-js@1.234.9: + posthog-js@1.235.4: dependencies: core-js: 3.41.0 fflate: 0.4.8