From 5c33991ddf581bec947f14123caa9d17b64fb91e Mon Sep 17 00:00:00 2001 From: Travis Jenkins Date: Mon, 15 Dec 2025 18:25:24 -0500 Subject: [PATCH 01/27] Starting to get PH stuff wired up --- .env | 5 +++ .env.development.local | 1 + .licensee.json | 3 ++ package-lock.json | 74 +++++++++++++++++++++++++++++---- package.json | 2 + src/app/guards/User.tsx | 2 + src/context/GlobalProviders.tsx | 2 + src/context/PostHog.tsx | 24 +++++++++++ src/context/User/index.tsx | 4 ++ src/context/index.tsx | 45 ++++++++++---------- src/services/gtm.ts | 3 ++ src/services/posthog.ts | 38 +++++++++++++++++ src/types/global.ts | 3 ++ src/utils/env-utils.ts | 12 ++++++ 14 files changed, 190 insertions(+), 28 deletions(-) create mode 100644 src/context/PostHog.tsx create mode 100644 src/services/posthog.ts diff --git a/.env b/.env index 0aef88acca..1b5ce02d13 100644 --- a/.env +++ b/.env @@ -50,6 +50,11 @@ VITE_LOGROCKET_ID_USER=true VITE_LOGROCKET_ID_USER_INCLUDE_NAME=true VITE_LOGROCKET_ID_USER_INCLUDE_EMAIL=true +VITE_PH_ENABLED=true +VITE_PH_ID_USER=true +VITE_PH_PUBLIC_API_TOKEN=phc_f0PRTM1hKZA6qHa6O3n01chjvC3PMy4wG72gnfXyL7t +VITE_PH_API_HOST=https://us.i.posthog.com + # Analytics settings VITE_GOOGLE_TAG_MANAGER_ENABLED=true VITE_GOOGLE_TAG_MANAGER_ID=GTM-W5CPN35W diff --git a/.env.development.local b/.env.development.local index d40ec98c86..35a4708a6d 100644 --- a/.env.development.local +++ b/.env.development.local @@ -30,6 +30,7 @@ VITE_ENCRYPTION_URL=http://localhost:8765/v1/encrypt-config # If you enable this your setting local data will go to production LogRocket VITE_LOGROCKET_ENABLED=false + # Analytics settings VITE_GOOGLE_TAG_MANAGER_ENABLED=false diff --git a/.licensee.json b/.licensee.json index 423ebc9807..e9a2bfb782 100644 --- a/.licensee.json +++ b/.licensee.json @@ -41,6 +41,9 @@ "// BSL (only when hacking it in)": "0.0.0", "flow-web": "0.5.12", + "// Apache": "0.0.0", + "posthog-js": "1.306.2", + "// LGPL - only used for image processing and easy to remove": "0.0.0", "@img/sharp-libvips-linux-x64": "1.1.0", "@img/sharp-libvips-linuxmusl-x64": "1.1.0", diff --git a/package-lock.json b/package-lock.json index d3e6f0782b..8c088e619e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "@mui/utils": "^5.15.11", "@mui/x-data-grid": "^6.11.2", "@mui/x-date-pickers": "^6.19.5", + "@posthog/react": "^1.5.2", "@stripe/react-stripe-js": "^2.1.0", "@stripe/stripe-js": "^1.52.1", "@supabase-cache-helpers/postgrest-swr": "^2.0.1", @@ -58,6 +59,7 @@ "monaco-editor": "^0.53.0", "notistack": "^3.0.1", "p-limit": "^5.0.0", + "posthog-js": "^1.306.2", "pretty-bytes": "^6.1.0", "react": "^17.0.2", "react-csv-downloader": "^3.1.0", @@ -3389,6 +3391,29 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/@posthog/core": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@posthog/core/-/core-1.7.1.tgz", + "integrity": "sha512-kjK0eFMIpKo9GXIbts8VtAknsoZ18oZorANdtuTj1CbgS28t4ZVq//HAWhnxEuXRTrtkd+SUJ6Ux3j2Af8NCuA==", + "dependencies": { + "cross-spawn": "^7.0.6" + } + }, + "node_modules/@posthog/react": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@posthog/react/-/react-1.5.2.tgz", + "integrity": "sha512-KHdXbV1yba7Y2l8BVmwXlySWxqKVLNQ5ZiVvWOf7r3Eo7GIFxCM4CaNK/z83kKWn8KTskmKy7AGF6Hl6INWK3g==", + "peerDependencies": { + "@types/react": ">=16.8.0", + "posthog-js": ">=1.257.2", + "react": ">=16.8.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/@remix-run/router": { "version": "1.23.0", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.23.0.tgz", @@ -5970,6 +5995,16 @@ "toggle-selection": "^1.0.6" } }, + "node_modules/core-js": { + "version": "3.47.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.47.0.tgz", + "integrity": "sha512-c3Q2VVkGAUyupsjRnaNX6u8Dq2vAdzm9iuPj5FW0fRxzlxgq9Q39MDq10IvmQSpLgHQNyQzQmOo6bgGHmH3NNg==", + "hasInstallScript": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, "node_modules/core-js-pure": { "version": "3.43.0", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.43.0.tgz", @@ -6066,7 +6101,6 @@ "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -9173,8 +9207,7 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/isomorphic-timers-promises": { "version": "1.0.1", @@ -11158,7 +11191,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "engines": { "node": ">=8" } @@ -11367,6 +11399,32 @@ "node": ">=4" } }, + "node_modules/posthog-js": { + "version": "1.306.2", + "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.306.2.tgz", + "integrity": "sha512-zBEjDvUs5RNTWbyHVjbL16Oigm2buFG2PQRRMC46hfL2HSh+8//zMD5gV3etxkUhjjTltKubK3mkqONMldw9Yg==", + "dependencies": { + "@posthog/core": "1.7.1", + "core-js": "^3.38.1", + "fflate": "^0.4.8", + "preact": "^10.19.3", + "web-vitals": "^4.2.4" + } + }, + "node_modules/posthog-js/node_modules/fflate": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.4.8.tgz", + "integrity": "sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA==" + }, + "node_modules/preact": { + "version": "10.28.0", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.28.0.tgz", + "integrity": "sha512-rytDAoiXr3+t6OIP3WGlDd0ouCUG1iCWzkcY3++Nreuoi17y6T5i/zRhe6uYfoVcxq6YU+sBtJouuRDsq8vvqA==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -12795,7 +12853,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -12807,7 +12864,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "engines": { "node": ">=8" } @@ -14837,6 +14893,11 @@ "integrity": "sha512-9YlCL/ynK3CTlrSRrDxZvUauLzAswPCrsaCgilqFevUYpeEW0/3ScEjaa3kbW/T0ghhkEr7mv+fpjqn1Y1YuTA==", "dev": true }, + "node_modules/web-vitals": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-4.2.4.tgz", + "integrity": "sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw==" + }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -14876,7 +14937,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "dependencies": { "isexe": "^2.0.0" }, diff --git a/package.json b/package.json index 4dc52ea5e0..58f529dd6a 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "@mui/utils": "^5.15.11", "@mui/x-data-grid": "^6.11.2", "@mui/x-date-pickers": "^6.19.5", + "@posthog/react": "^1.5.2", "@stripe/react-stripe-js": "^2.1.0", "@stripe/stripe-js": "^1.52.1", "@supabase-cache-helpers/postgrest-swr": "^2.0.1", @@ -82,6 +83,7 @@ "monaco-editor": "^0.53.0", "notistack": "^3.0.1", "p-limit": "^5.0.0", + "posthog-js": "^1.306.2", "pretty-bytes": "^6.1.0", "react": "^17.0.2", "react-csv-downloader": "^3.1.0", diff --git a/src/app/guards/User.tsx b/src/app/guards/User.tsx index c1ceda9480..e9b8f035b9 100644 --- a/src/app/guards/User.tsx +++ b/src/app/guards/User.tsx @@ -13,6 +13,7 @@ import type { BaseComponentProps } from 'src/types'; import { Navigate } from 'react-router'; import { identifyUser } from 'src/services/logrocket'; +import { posthogIdentify } from 'src/services/posthog'; function UserGuard({ children }: BaseComponentProps) { // We only want to idenfity users once. Since the user object changes @@ -25,6 +26,7 @@ function UserGuard({ children }: BaseComponentProps) { if (user && !identifiedUser.current) { identifiedUser.current = true; identifyUser(user); + posthogIdentify(user); } }, [user]); diff --git a/src/context/GlobalProviders.tsx b/src/context/GlobalProviders.tsx index 864271fe11..8b433753ff 100644 --- a/src/context/GlobalProviders.tsx +++ b/src/context/GlobalProviders.tsx @@ -25,6 +25,8 @@ if ( // before the `createClient` call made below for Supabase initLogRocket(); +// PostHog's init is in `ui/src/context/PostHog.tsx` + // Setup immer enableMapSet(); setAutoFreeze(false); diff --git a/src/context/PostHog.tsx b/src/context/PostHog.tsx new file mode 100644 index 0000000000..55c2dcbd87 --- /dev/null +++ b/src/context/PostHog.tsx @@ -0,0 +1,24 @@ +import type { BaseComponentProps } from 'src/types'; + +import { PostHogProvider } from '@posthog/react'; +import posthog from 'posthog-js'; + +import { getPostHogSettings } from 'src/utils/env-utils'; + +const postHogSettings = getPostHogSettings(); + +(() => { + if (typeof window === 'undefined' || !postHogSettings) { + return; + } + + posthog.init(postHogSettings.publicToken, { + api_host: postHogSettings.apiHost, + defaults: '2025-05-24', + cookieless_mode: 'on_reject', + }); +})(); + +export function PHProvider({ children }: BaseComponentProps) { + return {children}; +} diff --git a/src/context/User/index.tsx b/src/context/User/index.tsx index 975dcefcf5..2767d69dcf 100644 --- a/src/context/User/index.tsx +++ b/src/context/User/index.tsx @@ -2,6 +2,8 @@ import type { BaseComponentProps } from 'src/types'; import { useEffect } from 'react'; +import posthog from 'posthog-js'; + import { supabaseClient } from 'src/context/GlobalProviders'; import { useUserStore } from 'src/context/User/useUserContextStore'; import { @@ -37,6 +39,8 @@ const UserStoreProvider = ({ children }: BaseComponentProps) => { logRocketEvent(CustomEvents.AUTH_SIGNOUT, { trigger: 'UserContext:session', }); + console.log('logout'); + posthog.reset(); return; } diff --git a/src/context/index.tsx b/src/context/index.tsx index 04157e0518..212f1192fe 100644 --- a/src/context/index.tsx +++ b/src/context/index.tsx @@ -5,6 +5,7 @@ import ContentProvider from 'src/context/Content'; import GlobalProviders from 'src/context/GlobalProviders'; import IconoirProvider from 'src/context/Iconoir'; import NotificationProvider from 'src/context/Notifications'; +import { PHProvider } from 'src/context/PostHog'; import { SidePanelDocsProvider } from 'src/context/SidePanelDocs'; import SwrConfigProvider from 'src/context/SWR'; import { TableSettingsProvider } from 'src/context/TableSettings'; @@ -17,27 +18,29 @@ const AppProviders = ({ children }: BaseComponentProps) => { return ( - - - - - - - - - - - {children} - - - - - - - - - - + + + + + + + + + + + + {children} + + + + + + + + + + + ); diff --git a/src/services/gtm.ts b/src/services/gtm.ts index f885a071a0..41f4065610 100644 --- a/src/services/gtm.ts +++ b/src/services/gtm.ts @@ -1,5 +1,6 @@ import type { Schema } from 'src/types'; +import { posthogCapture } from 'src/services/posthog'; import { getGoogleTageManagerSettings } from 'src/utils/env-utils'; // GTM is loaded/initialized in index.html @@ -20,6 +21,8 @@ export const fireGtmEvent = (event: EVENTS, data: Schema | undefined = {}) => { ...data, }); } + + posthogCapture(event, data); }; export const setGtmData = (data?: Schema) => { diff --git a/src/services/posthog.ts b/src/services/posthog.ts new file mode 100644 index 0000000000..cd4ccb4bc8 --- /dev/null +++ b/src/services/posthog.ts @@ -0,0 +1,38 @@ +import type { User } from '@supabase/supabase-js'; + +import posthog from 'posthog-js'; + +import { getUserDetails } from 'src/services/shared'; +import { getPostHogSettings } from 'src/utils/env-utils'; + +const postHogSettings = getPostHogSettings(); + +export const posthogCapture = (event: string, data?: any) => { + if (!postHogSettings) { + return; + } + + return posthog.capture(event, { + est_event_data: data ?? {}, + }); +}; + +export const posthogIdentify = (user: User) => { + if (!postHogSettings || !postHogSettings?.idUser) { + return; + } + const userDetails = getUserDetails(user); + + if (!userDetails) { + return; + } + + const { id, email, emailVerified, userName, usedSSO } = userDetails; + return posthog.identify(id, { + lastLogin: new Date(), + email, + emailVerified, + userName, + usedSSO, + }); +}; diff --git a/src/types/global.ts b/src/types/global.ts index cf83ea8cf0..6c314f65a4 100644 --- a/src/types/global.ts +++ b/src/types/global.ts @@ -11,6 +11,9 @@ declare global { monaco: any; MonacoEnvironment: Environment; __REDUX_DEVTOOLS_EXTENSION__: any; + posthog?: { + init: Function; + }; // TODO (integrity | logrocket) // When we load in LogRocket with a script tag we'll want this // LogRocket?: { diff --git a/src/utils/env-utils.ts b/src/utils/env-utils.ts index 754d060973..43badecc49 100644 --- a/src/utils/env-utils.ts +++ b/src/utils/env-utils.ts @@ -102,6 +102,18 @@ export const getLogRocketSettings = (): Settings | null => { return null; }; +export const getPostHogSettings = () => { + if (import.meta.env.VITE_PH_ENABLED === ENABLED) { + return { + apiHost: import.meta.env.VITE_PH_API_HOST ?? null, + publicToken: import.meta.env.VITE_PH_PUBLIC_API_TOKEN ?? null, + idUser: import.meta.env.VITE_PH_ID_USER === ENABLED, + }; + } + + return null; +}; + export const getEncryptionSettings = () => { const encryptionEndpoint = import.meta.env.VITE_ENCRYPTION_URL; From c201fa98ac123da4bedaa640746fe7e2aeb8f698 Mon Sep 17 00:00:00 2001 From: Travis Jenkins Date: Mon, 15 Dec 2025 18:33:36 -0500 Subject: [PATCH 02/27] Not firing identify multiple times --- src/services/posthog.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/services/posthog.ts b/src/services/posthog.ts index cd4ccb4bc8..fc2aa11b23 100644 --- a/src/services/posthog.ts +++ b/src/services/posthog.ts @@ -23,16 +23,13 @@ export const posthogIdentify = (user: User) => { } const userDetails = getUserDetails(user); - if (!userDetails) { + if (!userDetails || posthog._isIdentified()) { return; } - const { id, email, emailVerified, userName, usedSSO } = userDetails; + const { id, avatar, ...theRest } = userDetails; return posthog.identify(id, { lastLogin: new Date(), - email, - emailVerified, - userName, - usedSSO, + ...theRest, }); }; From 911a4b014a516918ecf29a750c8a4875820cd41b Mon Sep 17 00:00:00 2001 From: Travis Jenkins Date: Mon, 15 Dec 2025 18:33:54 -0500 Subject: [PATCH 03/27] I prefer being very explicit here --- src/services/posthog.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/services/posthog.ts b/src/services/posthog.ts index fc2aa11b23..7c12c58598 100644 --- a/src/services/posthog.ts +++ b/src/services/posthog.ts @@ -27,9 +27,12 @@ export const posthogIdentify = (user: User) => { return; } - const { id, avatar, ...theRest } = userDetails; + const { id, email, emailVerified, userName, usedSSO } = userDetails; return posthog.identify(id, { lastLogin: new Date(), - ...theRest, + email, + emailVerified, + userName, + usedSSO, }); }; From c5d62ab21c21e2cf74c29080c91f9d48210d9c55 Mon Sep 17 00:00:00 2001 From: Travis Jenkins Date: Tue, 13 Jan 2026 14:50:03 -0500 Subject: [PATCH 04/27] Updating to latest --- package-lock.json | 396 ++++++++++++++++++++++++++++++++++++++++++++-- package.json | 2 +- 2 files changed, 388 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index f1a4c539c2..f6017216c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,7 +59,7 @@ "monaco-editor": "^0.53.0", "notistack": "^3.0.1", "p-limit": "^5.0.0", - "posthog-js": "^1.306.2", + "posthog-js": "^1.319.2", "pretty-bytes": "^6.1.0", "react": "^17.0.2", "react-csv-downloader": "^3.1.0", @@ -3358,6 +3358,252 @@ "dev": true, "license": "MIT" }, + "node_modules/@opentelemetry/api": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", + "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", + "license": "Apache-2.0", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@opentelemetry/api-logs": { + "version": "0.208.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.208.0.tgz", + "integrity": "sha512-CjruKY9V6NMssL/T1kAFgzosF1v9o6oeN+aX5JB/C/xPNtmgIJqcXHG7fA82Ou1zCpWGl4lROQUKwUNE1pMCyg==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api": "^1.3.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@opentelemetry/core": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.2.0.tgz", + "integrity": "sha512-FuabnnUm8LflnieVxs6eP7Z383hgQU4W1e3KJS6aOG3RxWxcHyBxH8fDMHNgu/gFx/M2jvTOW/4/PHhLz6bjWw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/exporter-logs-otlp-http": { + "version": "0.208.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-logs-otlp-http/-/exporter-logs-otlp-http-0.208.0.tgz", + "integrity": "sha512-jOv40Bs9jy9bZVLo/i8FwUiuCvbjWDI+ZW13wimJm4LjnlwJxGgB+N/VWOZUTpM+ah/awXeQqKdNlpLf2EjvYg==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "0.208.0", + "@opentelemetry/core": "2.2.0", + "@opentelemetry/otlp-exporter-base": "0.208.0", + "@opentelemetry/otlp-transformer": "0.208.0", + "@opentelemetry/sdk-logs": "0.208.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/otlp-exporter-base": { + "version": "0.208.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.208.0.tgz", + "integrity": "sha512-gMd39gIfVb2OgxldxUtOwGJYSH8P1kVFFlJLuut32L6KgUC4gl1dMhn+YC2mGn0bDOiQYSk/uHOdSjuKp58vvA==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.2.0", + "@opentelemetry/otlp-transformer": "0.208.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/otlp-transformer": { + "version": "0.208.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.208.0.tgz", + "integrity": "sha512-DCFPY8C6lAQHUNkzcNT9R+qYExvsk6C5Bto2pbNxgicpcSWbe2WHShLxkOxIdNcBiYPdVHv/e7vH7K6TI+C+fQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "0.208.0", + "@opentelemetry/core": "2.2.0", + "@opentelemetry/resources": "2.2.0", + "@opentelemetry/sdk-logs": "0.208.0", + "@opentelemetry/sdk-metrics": "2.2.0", + "@opentelemetry/sdk-trace-base": "2.2.0", + "protobufjs": "^7.3.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/resources": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.2.0.tgz", + "integrity": "sha512-1pNQf/JazQTMA0BiO5NINUzH0cbLbbl7mntLa4aJNmCCXSj0q03T5ZXXL0zw4G55TjdL9Tz32cznGClf+8zr5A==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.2.0", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/resources": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.3.0.tgz", + "integrity": "sha512-shlr2l5g+87J8wqYlsLyaUsgKVRO7RtX70Ckd5CtDOWtImZgaUDmf4Z2ozuSKQLM2wPDR0TE/3bPVBNJtRm/cQ==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.3.0", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.3.0.tgz", + "integrity": "sha512-PcmxJQzs31cfD0R2dE91YGFcLxOSN4Bxz7gez5UwSUjCai8BwH/GI5HchfVshHkWdTkUs0qcaPJgVHKXUp7I3A==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-logs": { + "version": "0.208.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.208.0.tgz", + "integrity": "sha512-QlAyL1jRpOeaqx7/leG1vJMp84g0xKP6gJmfELBpnI4O/9xPX+Hu5m1POk9Kl+veNkyth5t19hRlN6tNY1sjbA==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "0.208.0", + "@opentelemetry/core": "2.2.0", + "@opentelemetry/resources": "2.2.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.4.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/resources": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.2.0.tgz", + "integrity": "sha512-1pNQf/JazQTMA0BiO5NINUzH0cbLbbl7mntLa4aJNmCCXSj0q03T5ZXXL0zw4G55TjdL9Tz32cznGClf+8zr5A==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.2.0", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-metrics": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-2.2.0.tgz", + "integrity": "sha512-G5KYP6+VJMZzpGipQw7Giif48h6SGQ2PFKEYCybeXJsOCB4fp8azqMAAzE5lnnHK3ZVwYQrgmFbsUJO/zOnwGw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.2.0", + "@opentelemetry/resources": "2.2.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.9.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/resources": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.2.0.tgz", + "integrity": "sha512-1pNQf/JazQTMA0BiO5NINUzH0cbLbbl7mntLa4aJNmCCXSj0q03T5ZXXL0zw4G55TjdL9Tz32cznGClf+8zr5A==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.2.0", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-trace-base": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-2.2.0.tgz", + "integrity": "sha512-xWQgL0Bmctsalg6PaXExmzdedSp3gyKV8mQBwK/j9VGdCDu2fmXIb2gAehBKbkXCpJ4HPkgv3QfoJWRT4dHWbw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.2.0", + "@opentelemetry/resources": "2.2.0", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.2.0.tgz", + "integrity": "sha512-1pNQf/JazQTMA0BiO5NINUzH0cbLbbl7mntLa4aJNmCCXSj0q03T5ZXXL0zw4G55TjdL9Tz32cznGClf+8zr5A==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "2.2.0", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": "^18.19.0 || >=20.6.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/semantic-conventions": { + "version": "1.38.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.38.0.tgz", + "integrity": "sha512-kocjix+/sSggfJhwXqClZ3i9Y/MI0fp7b+g7kCRm6psy2dsf8uApTRclwG18h8Avm7C9+fnt+O36PspJ/OzoWg==", + "license": "Apache-2.0", + "engines": { + "node": ">=14" + } + }, "node_modules/@paralleldrive/cuid2": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.2.2.tgz", @@ -3393,9 +3639,10 @@ } }, "node_modules/@posthog/core": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@posthog/core/-/core-1.7.1.tgz", - "integrity": "sha512-kjK0eFMIpKo9GXIbts8VtAknsoZ18oZorANdtuTj1CbgS28t4ZVq//HAWhnxEuXRTrtkd+SUJ6Ux3j2Af8NCuA==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@posthog/core/-/core-1.9.1.tgz", + "integrity": "sha512-kRb1ch2dhQjsAapZmu6V66551IF2LnCbc1rnrQqnR7ArooVyJN9KOPXre16AJ3ObJz2eTfuP7x25BMyS2Y5Exw==", + "license": "MIT", "dependencies": { "cross-spawn": "^7.0.6" } @@ -3415,6 +3662,76 @@ } } }, + "node_modules/@posthog/types": { + "version": "1.319.2", + "resolved": "https://registry.npmjs.org/@posthog/types/-/types-1.319.2.tgz", + "integrity": "sha512-mGyQx5T4mpX+r4hyFKXJ41sck7WkWSiPgq7NTDGPbFPNW9F2mtD0R+myDhXxHrQUxAEa9ZIgrIvysTY37UYagA==", + "license": "MIT" + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "license": "BSD-3-Clause" + }, "node_modules/@remix-run/router": { "version": "1.23.0", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.23.0.tgz", @@ -6541,6 +6858,22 @@ "url": "https://bevry.me/fund" } }, + "node_modules/dompurify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.1.tgz", + "integrity": "sha512-qkdCKzLNtrgPFP1Vo+98FRzJnBRGe4ffyCea9IwHB1fyxPOeNTHpLKYGd4Uk9xvNoH0ZoOjwZxNptyMwqrId1Q==", + "license": "(MPL-2.0 OR Apache-2.0)", + "optionalDependencies": { + "@types/trusted-types": "^2.0.7" + } + }, + "node_modules/dompurify/node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "license": "MIT", + "optional": true + }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", @@ -9746,6 +10079,12 @@ "react-dom": ">=17.0" } }, + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0" + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -11389,14 +11728,23 @@ } }, "node_modules/posthog-js": { - "version": "1.306.2", - "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.306.2.tgz", - "integrity": "sha512-zBEjDvUs5RNTWbyHVjbL16Oigm2buFG2PQRRMC46hfL2HSh+8//zMD5gV3etxkUhjjTltKubK3mkqONMldw9Yg==", - "dependencies": { - "@posthog/core": "1.7.1", + "version": "1.319.2", + "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.319.2.tgz", + "integrity": "sha512-mYFoRPSYZ34Ywdz3Ph4ME/md5H60NoKc8I/DTEr31YEGIC6dYKOOWBRFO/MLMvnAny5C7VEir8YE5dQ9484vPw==", + "license": "SEE LICENSE IN LICENSE", + "dependencies": { + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/api-logs": "^0.208.0", + "@opentelemetry/exporter-logs-otlp-http": "^0.208.0", + "@opentelemetry/resources": "^2.2.0", + "@opentelemetry/sdk-logs": "^0.208.0", + "@posthog/core": "1.9.1", + "@posthog/types": "1.319.2", "core-js": "^3.38.1", + "dompurify": "^3.3.1", "fflate": "^0.4.8", "preact": "^10.19.3", + "query-selector-shadow-dom": "^1.0.1", "web-vitals": "^4.2.4" } }, @@ -11570,6 +11918,30 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "node_modules/protobufjs": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz", + "integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -11618,6 +11990,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/query-selector-shadow-dom": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/query-selector-shadow-dom/-/query-selector-shadow-dom-1.0.1.tgz", + "integrity": "sha512-lT5yCqEBgfoMYpf3F2xQRK7zEr1rhIIZuceDK6+xRkJQ4NMbHTwXqk4NkwDwQMNqXgG9r9fyHnzwNVs6zV5KRw==", + "license": "MIT" + }, "node_modules/querystring": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", diff --git a/package.json b/package.json index fb8e0026ea..a57d210e20 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "monaco-editor": "^0.53.0", "notistack": "^3.0.1", "p-limit": "^5.0.0", - "posthog-js": "^1.306.2", + "posthog-js": "^1.319.2", "pretty-bytes": "^6.1.0", "react": "^17.0.2", "react-csv-downloader": "^3.1.0", From 4b581560df1c4f16c23e22dbfbf4de0e5321d9a6 Mon Sep 17 00:00:00 2001 From: Travis Jenkins Date: Tue, 13 Jan 2026 14:50:48 -0500 Subject: [PATCH 05/27] updating the license json for posthog upgrade --- .licensee.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.licensee.json b/.licensee.json index e9a2bfb782..175b508c88 100644 --- a/.licensee.json +++ b/.licensee.json @@ -42,7 +42,7 @@ "flow-web": "0.5.12", "// Apache": "0.0.0", - "posthog-js": "1.306.2", + "posthog-js": "1.319.2", "// LGPL - only used for image processing and easy to remove": "0.0.0", "@img/sharp-libvips-linux-x64": "1.1.0", From fc599002375adb0fd33f1f018e16c2ad2d312b4f Mon Sep 17 00:00:00 2001 From: Travis Jenkins Date: Tue, 13 Jan 2026 16:38:51 -0500 Subject: [PATCH 06/27] some cleaning up and tweaks and marking info --- .env.development.local | 8 +++----- src/services/shared.ts | 13 +++---------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/.env.development.local b/.env.development.local index 35a4708a6d..606c8cd5ce 100644 --- a/.env.development.local +++ b/.env.development.local @@ -26,12 +26,10 @@ VITE_URLS_TERMS_OF_SERVICE=/terms.html # Sops Encryption settings VITE_ENCRYPTION_URL=http://localhost:8765/v1/encrypt-config -# LogRocket settings -# If you enable this your setting local data will go to production LogRocket +# Analytic Settings +# Enabling these locally will cause data to go to production analytics tools +VITE_PH_ENABLED=false VITE_LOGROCKET_ENABLED=false - - -# Analytics settings VITE_GOOGLE_TAG_MANAGER_ENABLED=false VITE_DOCS_ORIGIN=http://localhost:3001 diff --git a/src/services/shared.ts b/src/services/shared.ts index 6aed1aabf3..81bf5a4f06 100644 --- a/src/services/shared.ts +++ b/src/services/shared.ts @@ -44,11 +44,7 @@ export const getUserDetails = ( }; export const logRocketConsole = (message: string, ...props: any[]) => { - // Just want to be very very safe - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (LogRocket?.log) { - LogRocket.log(message, props); - } + LogRocket.log(message, props); if (!isProduction) { console.log(message, props); @@ -60,11 +56,8 @@ export const logRocketEvent = ( event: CustomEvents | KnownEvents | (string & {}), eventProperties?: any ) => { - // Just want to be very very safe - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (LogRocket?.track) { - LogRocket.track(event, eventProperties); - } + // !!! NO POSTHOG TRACKING HERE !!! - this could leak confiential information + LogRocket.track(event, eventProperties); logRocketConsole(`Event Logging : ${event}`, eventProperties); }; From 7667be20be508508c0fb9acf307c091e69688aef Mon Sep 17 00:00:00 2001 From: Travis Jenkins Date: Tue, 13 Jan 2026 16:44:56 -0500 Subject: [PATCH 07/27] making sure props are there --- src/utils/env-utils.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/utils/env-utils.ts b/src/utils/env-utils.ts index 43badecc49..e43e5fa9ef 100644 --- a/src/utils/env-utils.ts +++ b/src/utils/env-utils.ts @@ -104,6 +104,13 @@ export const getLogRocketSettings = (): Settings | null => { export const getPostHogSettings = () => { if (import.meta.env.VITE_PH_ENABLED === ENABLED) { + if ( + !import.meta.env.VITE_PH_API_HOST || + !import.meta.env.VITE_PH_PUBLIC_API_TOKEN + ) { + return null; + } + return { apiHost: import.meta.env.VITE_PH_API_HOST ?? null, publicToken: import.meta.env.VITE_PH_PUBLIC_API_TOKEN ?? null, From ab90b9a86fe319c2356aa012b7e2c1b363794c29 Mon Sep 17 00:00:00 2001 From: Travis Jenkins Date: Tue, 13 Jan 2026 16:54:31 -0500 Subject: [PATCH 08/27] updating CSP related stuff --- public/nginx.conf | 5 +++-- src/context/PostHog.tsx | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/public/nginx.conf b/public/nginx.conf index 1ba11bc595..b1e1a651d1 100644 --- a/public/nginx.conf +++ b/public/nginx.conf @@ -87,6 +87,7 @@ http { # CSP docs (do NOT trust 100% as sometimes they are outdated) # Google - https://developers.google.com/tag-platform/security/guides/csp # Log Rocket - https://docs.logrocket.com/docs/troubleshooting-sessions#due-to-content-security-policy + # PostHog - https://posthog.com/docs/advanced/content-security-policy # Stripe - https://docs.stripe.com/security/guide#content-security-policy # BE CAREFUL WHEN EDITING # This is all pretty brittle @@ -95,9 +96,9 @@ http { # Add to connect-src if testing dev `http://localhost:5431 http://localhost:8675 https://flow.localhost:9000` add_header Content-Security-Policy " default-src 'self'; - connect-src 'self' https://*.estuary-data.com https://*.estuary-data.dev https://config-encryption.estuary.dev https://eyrcnmuzzyriypdajwdk.supabase.co https://agent-api-1084703453822.us-central1.run.app https://gcp-marketplace-verify-mo7rswd2xq-uc.a.run.app https://google.com https://www.google.com https://*.google.com https://stats.g.doubleclick.net https://*.logrocket.io https://*.lr-ingest.io https://*.logrocket.com https://*.lr-in.com https://*.lr-in-prod.com https://*.lr-ingest.com https://*.ingest-lr.com https://*.lr-intake.com https://*.intake-lr.com https://*.logr-ingest.com https://*.lrkt-in.com https://*.lgrckt-in.com https://api.stripe.com https://maps.googleapis.com; + connect-src 'self' https://*.estuary-data.com https://*.estuary-data.dev https://config-encryption.estuary.dev https://eyrcnmuzzyriypdajwdk.supabase.co https://agent-api-1084703453822.us-central1.run.app https://gcp-marketplace-verify-mo7rswd2xq-uc.a.run.app https://google.com https://www.google.com https://*.google.com https://stats.g.doubleclick.net https://*.logrocket.io https://*.lr-ingest.io https://*.logrocket.com https://*.lr-in.com https://*.lr-in-prod.com https://*.lr-ingest.com https://*.ingest-lr.com https://*.lr-intake.com https://*.intake-lr.com https://*.logr-ingest.com https://*.lrkt-in.com https://*.lgrckt-in.com https://api.stripe.com https://maps.googleapis.com https://*.posthog.com; frame-src 'self' https://docs.estuary.dev https://go.estuary.dev https://connect-js.stripe.com https://js.stripe.com https://*.js.stripe.com https://hooks.stripe.com https://td.doubleclick.net https://www.googletagmanager.com; - script-src 'self' 'unsafe-eval' 'nonce-$cspNonce' https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.g.doubleclick.net https://*.google.com https://*.stripe.network https://*.js.stripe.com https://js.stripe.com https://maps.googleapis.com https://cdn.logrocket.io https://cdn.lr-ingest.io https://cdn.lr-in.com https://cdn.lr-in-prod.com https://cdn.lr-ingest.com https://cdn.ingest-lr.com https://cdn.lr-intake.com https://cdn.intake-lr.com https://cdn.logr-ingest.com https://cdn.lrkt-in.com https://cdn.lgrckt-in.com; + script-src 'self' 'unsafe-eval' 'nonce-$cspNonce' https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.g.doubleclick.net https://*.google.com https://*.stripe.network https://*.js.stripe.com https://js.stripe.com https://maps.googleapis.com https://cdn.logrocket.io https://cdn.lr-ingest.io https://cdn.lr-in.com https://cdn.lr-in-prod.com https://cdn.lr-ingest.com https://cdn.ingest-lr.com https://cdn.lr-intake.com https://cdn.intake-lr.com https://cdn.logr-ingest.com https://cdn.lrkt-in.com https://cdn.lgrckt-in.com https://*.posthog.com; base-uri 'self'; child-src 'self' blob:; font-src 'self' data: https:; diff --git a/src/context/PostHog.tsx b/src/context/PostHog.tsx index 55c2dcbd87..6b91d4c49b 100644 --- a/src/context/PostHog.tsx +++ b/src/context/PostHog.tsx @@ -16,6 +16,16 @@ const postHogSettings = getPostHogSettings(); api_host: postHogSettings.apiHost, defaults: '2025-05-24', cookieless_mode: 'on_reject', + // TODO (PostHog) + // https://posthog.com/docs/advanced/content-security-policy#supporting-nonce-directives + // prepare_external_dependency_script: (script) => { + // script.nonce = ''; + // return script; + // }, + // prepare_external_dependency_stylesheet: (stylesheet) => { + // stylesheet.nonce = ''; + // return stylesheet; + // }, }); })(); From 145ced2550456d05c26c0b6290f72602bf887c9a Mon Sep 17 00:00:00 2001 From: Travis Jenkins Date: Wed, 14 Jan 2026 09:53:03 -0500 Subject: [PATCH 09/27] Removing comment as it probably makes more sense to just do a reverse proxy --- src/context/PostHog.tsx | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/context/PostHog.tsx b/src/context/PostHog.tsx index 6b91d4c49b..55c2dcbd87 100644 --- a/src/context/PostHog.tsx +++ b/src/context/PostHog.tsx @@ -16,16 +16,6 @@ const postHogSettings = getPostHogSettings(); api_host: postHogSettings.apiHost, defaults: '2025-05-24', cookieless_mode: 'on_reject', - // TODO (PostHog) - // https://posthog.com/docs/advanced/content-security-policy#supporting-nonce-directives - // prepare_external_dependency_script: (script) => { - // script.nonce = ''; - // return script; - // }, - // prepare_external_dependency_stylesheet: (stylesheet) => { - // stylesheet.nonce = ''; - // return stylesheet; - // }, }); })(); From 73e2d57a6ffcbb075bd10b7e177980be3e570af7 Mon Sep 17 00:00:00 2001 From: Travis Jenkins Date: Wed, 14 Jan 2026 09:53:59 -0500 Subject: [PATCH 10/27] Latest defaults seem to be fine --- src/context/PostHog.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context/PostHog.tsx b/src/context/PostHog.tsx index 55c2dcbd87..9c9867a9a3 100644 --- a/src/context/PostHog.tsx +++ b/src/context/PostHog.tsx @@ -14,7 +14,7 @@ const postHogSettings = getPostHogSettings(); posthog.init(postHogSettings.publicToken, { api_host: postHogSettings.apiHost, - defaults: '2025-05-24', + defaults: '2025-11-30', cookieless_mode: 'on_reject', }); })(); From 26f94488b386522aa0ebf3106b584d04910c88c8 Mon Sep 17 00:00:00 2001 From: Travis Jenkins Date: Wed, 14 Jan 2026 09:59:10 -0500 Subject: [PATCH 11/27] Adding google analytics to connect-src --- public/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/nginx.conf b/public/nginx.conf index b1e1a651d1..c2352131d1 100644 --- a/public/nginx.conf +++ b/public/nginx.conf @@ -96,7 +96,7 @@ http { # Add to connect-src if testing dev `http://localhost:5431 http://localhost:8675 https://flow.localhost:9000` add_header Content-Security-Policy " default-src 'self'; - connect-src 'self' https://*.estuary-data.com https://*.estuary-data.dev https://config-encryption.estuary.dev https://eyrcnmuzzyriypdajwdk.supabase.co https://agent-api-1084703453822.us-central1.run.app https://gcp-marketplace-verify-mo7rswd2xq-uc.a.run.app https://google.com https://www.google.com https://*.google.com https://stats.g.doubleclick.net https://*.logrocket.io https://*.lr-ingest.io https://*.logrocket.com https://*.lr-in.com https://*.lr-in-prod.com https://*.lr-ingest.com https://*.ingest-lr.com https://*.lr-intake.com https://*.intake-lr.com https://*.logr-ingest.com https://*.lrkt-in.com https://*.lgrckt-in.com https://api.stripe.com https://maps.googleapis.com https://*.posthog.com; + connect-src 'self' https://*.estuary-data.com https://*.estuary-data.dev https://config-encryption.estuary.dev https://eyrcnmuzzyriypdajwdk.supabase.co https://agent-api-1084703453822.us-central1.run.app https://gcp-marketplace-verify-mo7rswd2xq-uc.a.run.app https://google.com https://www.google.com https://*.google.com https://stats.g.doubleclick.net https://*.logrocket.io https://*.lr-ingest.io https://*.logrocket.com https://*.lr-in.com https://*.lr-in-prod.com https://*.lr-ingest.com https://*.ingest-lr.com https://*.lr-intake.com https://*.intake-lr.com https://*.logr-ingest.com https://*.lrkt-in.com https://*.lgrckt-in.com https://api.stripe.com https://maps.googleapis.com https://*.posthog.com https://*.google-analytics.com https://*.analytics.google.com; frame-src 'self' https://docs.estuary.dev https://go.estuary.dev https://connect-js.stripe.com https://js.stripe.com https://*.js.stripe.com https://hooks.stripe.com https://td.doubleclick.net https://www.googletagmanager.com; script-src 'self' 'unsafe-eval' 'nonce-$cspNonce' https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.g.doubleclick.net https://*.google.com https://*.stripe.network https://*.js.stripe.com https://js.stripe.com https://maps.googleapis.com https://cdn.logrocket.io https://cdn.lr-ingest.io https://cdn.lr-in.com https://cdn.lr-in-prod.com https://cdn.lr-ingest.com https://cdn.ingest-lr.com https://cdn.lr-intake.com https://cdn.intake-lr.com https://cdn.logr-ingest.com https://cdn.lrkt-in.com https://cdn.lgrckt-in.com https://*.posthog.com; base-uri 'self'; From 0df96c9be91ea155f0c075e55d2c9a63266b87f5 Mon Sep 17 00:00:00 2001 From: Travis Jenkins Date: Wed, 14 Jan 2026 10:02:13 -0500 Subject: [PATCH 12/27] Some more CSP updates based on google docs --- public/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/nginx.conf b/public/nginx.conf index c2352131d1..37b989e38e 100644 --- a/public/nginx.conf +++ b/public/nginx.conf @@ -96,7 +96,7 @@ http { # Add to connect-src if testing dev `http://localhost:5431 http://localhost:8675 https://flow.localhost:9000` add_header Content-Security-Policy " default-src 'self'; - connect-src 'self' https://*.estuary-data.com https://*.estuary-data.dev https://config-encryption.estuary.dev https://eyrcnmuzzyriypdajwdk.supabase.co https://agent-api-1084703453822.us-central1.run.app https://gcp-marketplace-verify-mo7rswd2xq-uc.a.run.app https://google.com https://www.google.com https://*.google.com https://stats.g.doubleclick.net https://*.logrocket.io https://*.lr-ingest.io https://*.logrocket.com https://*.lr-in.com https://*.lr-in-prod.com https://*.lr-ingest.com https://*.ingest-lr.com https://*.lr-intake.com https://*.intake-lr.com https://*.logr-ingest.com https://*.lrkt-in.com https://*.lgrckt-in.com https://api.stripe.com https://maps.googleapis.com https://*.posthog.com https://*.google-analytics.com https://*.analytics.google.com; + connect-src 'self' https://*.estuary-data.com https://*.estuary-data.dev https://config-encryption.estuary.dev https://eyrcnmuzzyriypdajwdk.supabase.co https://agent-api-1084703453822.us-central1.run.app https://gcp-marketplace-verify-mo7rswd2xq-uc.a.run.app https://google.com https://www.google.com https://*.google.com https://stats.g.doubleclick.net https://*.logrocket.io https://*.lr-ingest.io https://*.logrocket.com https://*.lr-in.com https://*.lr-in-prod.com https://*.lr-ingest.com https://*.ingest-lr.com https://*.lr-intake.com https://*.intake-lr.com https://*.logr-ingest.com https://*.lrkt-in.com https://*.lgrckt-in.com https://api.stripe.com https://maps.googleapis.com https://*.posthog.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com; frame-src 'self' https://docs.estuary.dev https://go.estuary.dev https://connect-js.stripe.com https://js.stripe.com https://*.js.stripe.com https://hooks.stripe.com https://td.doubleclick.net https://www.googletagmanager.com; script-src 'self' 'unsafe-eval' 'nonce-$cspNonce' https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.g.doubleclick.net https://*.google.com https://*.stripe.network https://*.js.stripe.com https://js.stripe.com https://maps.googleapis.com https://cdn.logrocket.io https://cdn.lr-ingest.io https://cdn.lr-in.com https://cdn.lr-in-prod.com https://cdn.lr-ingest.com https://cdn.ingest-lr.com https://cdn.lr-intake.com https://cdn.intake-lr.com https://cdn.logr-ingest.com https://cdn.lrkt-in.com https://cdn.lgrckt-in.com https://*.posthog.com; base-uri 'self'; From c91fd7dddc36dfebc399c212629aea5d70cd826c Mon Sep 17 00:00:00 2001 From: Travis Jenkins Date: Wed, 14 Jan 2026 10:07:44 -0500 Subject: [PATCH 13/27] This is null a lot and being ignored --- src/app/guards/hooks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/guards/hooks.ts b/src/app/guards/hooks.ts index 322b14a656..812afa6abb 100644 --- a/src/app/guards/hooks.ts +++ b/src/app/guards/hooks.ts @@ -70,7 +70,7 @@ const useDirectiveGuard = ( // extra hook calls that end up getting "confused" useEffect(() => { logRocketEvent(CustomEvents.DIRECTIVE_GUARD_STATE, { - state: directiveState, + state: directiveState ?? 'null', }); setCalculatedState(directiveState); }, [directiveState]); From 34788f40b59c1cef48c67d14cf6014d630ec95c4 Mon Sep 17 00:00:00 2001 From: Travis Jenkins Date: Wed, 14 Jan 2026 10:20:18 -0500 Subject: [PATCH 14/27] Adding some more clarity --- src/services/shared.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/services/shared.ts b/src/services/shared.ts index 81bf5a4f06..da779b2289 100644 --- a/src/services/shared.ts +++ b/src/services/shared.ts @@ -56,7 +56,17 @@ export const logRocketEvent = ( event: CustomEvents | KnownEvents | (string & {}), eventProperties?: any ) => { - // !!! NO POSTHOG TRACKING HERE !!! - this could leak confiential information + // !!! NO AUTO POSTHOG TRACKING HERE !!! + // !!! NO AUTO POSTHOG TRACKING HERE !!! + // !!! NO AUTO POSTHOG TRACKING HERE !!! + // We use LogRocket for support so we can be a bit less strict with what + // we pass back as only engineers, support, etc. have access and the only + // this it is used for is support of the product. If you want to track something + // we are firing in LogRocket in PostHog then you need to ensure the `eventProperties` + // are safe to pass to PostHog. + // !!! NO AUTO POSTHOG TRACKING HERE !!! + // !!! NO AUTO POSTHOG TRACKING HERE !!! + // !!! NO AUTO POSTHOG TRACKING HERE !!! LogRocket.track(event, eventProperties); logRocketConsole(`Event Logging : ${event}`, eventProperties); From 490792c0c3e820351f9ba4c63b91402dd93a5d81 Mon Sep 17 00:00:00 2001 From: Travis Jenkins Date: Wed, 14 Jan 2026 11:06:49 -0500 Subject: [PATCH 15/27] cleaning up a bit --- src/utils/env-utils.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/utils/env-utils.ts b/src/utils/env-utils.ts index e43e5fa9ef..ff8b66ed5e 100644 --- a/src/utils/env-utils.ts +++ b/src/utils/env-utils.ts @@ -104,18 +104,15 @@ export const getLogRocketSettings = (): Settings | null => { export const getPostHogSettings = () => { if (import.meta.env.VITE_PH_ENABLED === ENABLED) { - if ( - !import.meta.env.VITE_PH_API_HOST || - !import.meta.env.VITE_PH_PUBLIC_API_TOKEN - ) { - return null; - } - - return { + const settings = { apiHost: import.meta.env.VITE_PH_API_HOST ?? null, publicToken: import.meta.env.VITE_PH_PUBLIC_API_TOKEN ?? null, idUser: import.meta.env.VITE_PH_ID_USER === ENABLED, }; + + if (Boolean(settings.apiHost && settings.publicToken)) { + return settings; + } } return null; From 8f8be6c943700b6afb09af804df11a785b68a24c Mon Sep 17 00:00:00 2001 From: Travis Jenkins Date: Wed, 14 Jan 2026 12:43:44 -0500 Subject: [PATCH 16/27] Firing the test and save click events --- src/components/shared/Entity/Actions/Save.tsx | 8 +++++++- src/services/gtm.ts | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/shared/Entity/Actions/Save.tsx b/src/components/shared/Entity/Actions/Save.tsx index a51c423bae..198b4ab261 100644 --- a/src/components/shared/Entity/Actions/Save.tsx +++ b/src/components/shared/Entity/Actions/Save.tsx @@ -10,6 +10,7 @@ import { } from 'src/components/editor/Store/hooks'; import useSave from 'src/components/shared/Entity/Actions/useSave'; import { entityHeaderButtonSx } from 'src/context/Theme'; +import { fireGtmEvent } from 'src/services/gtm'; import { useFormStateStore_isActive } from 'src/stores/FormState/hooks'; function EntityCreateSave({ @@ -29,18 +30,23 @@ function EntityCreateSave({ const formActive = useFormStateStore_isActive(); + const isDryRun = dryRun === true; + return (