diff --git a/gatsby-browser.js b/gatsby-browser.js index d0ebcb45e806..d376274137d2 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -1,4 +1,5 @@ import "./fonts.css"; +import posthog from "posthog-js"; document.addEventListener("DOMContentLoaded", () => { /** init gtm after 3500 seconds - this could be adjusted */ @@ -28,5 +29,16 @@ function initGTM() { document.head.appendChild(script); } +export const onClientEntry = () => { + if (process.env.NODE_ENV === "production") { + posthog.init("phc_Yynjz2lAiQDJFqTWeGT0FJrt50hl53WBx8do3eKImgX", + { + api_host: "https://us.i.posthog.com", + person_profiles: "always", + } + ); + } +}; + export { wrapRootElement } from "./root-wrapper"; export { wrapPageElement } from "./page-wrapper"; diff --git a/package-lock.json b/package-lock.json index 040e331e8ccd..0987bf42381a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,6 +60,7 @@ "lodash": "^4.17.21", "mui-datatables": "^4.3.0", "path-browserify": "^1.0.1", + "posthog-js": "^1.161.6", "prism-react-renderer": "^1.3.5", "process": "^0.11.10", "prop-types": "^15.7.2", @@ -2462,9 +2463,9 @@ } }, "node_modules/@fullcalendar/core": { - "version": "6.1.13", - "resolved": "https://registry.npmjs.org/@fullcalendar/core/-/core-6.1.13.tgz", - "integrity": "sha512-Cps/hMQan4kwnsBhFf2+m2mijbGoWs6r18ZzxBnAAOkkNHtPmHU8EdR6lF+ZLsiVvb7nsC4H/ZKqnxXWwgpoPw==", + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/@fullcalendar/core/-/core-6.1.15.tgz", + "integrity": "sha512-BuX7o6ALpLb84cMw1FCB9/cSgF4JbVO894cjJZ6kP74jzbUZNjtwffwRdA+Id8rrLjT30d/7TrkW90k4zbXB5Q==", "peer": true, "dependencies": { "preact": "~10.12.1" @@ -4041,9 +4042,9 @@ } }, "node_modules/@mui/icons-material": { - "version": "5.15.11", - "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.15.11.tgz", - "integrity": "sha512-R5ZoQqnKpd+5Ew7mBygTFLxgYsQHPhgR3TDXSgIHYIjGzYuyPLmGLSdcPUoMdi6kxiYqHlpPj4NJxlbaFD0UHA==", + "version": "5.16.7", + "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.16.7.tgz", + "integrity": "sha512-UrGwDJCXEszbDI7yV047BYU5A28eGJ79keTCP4cc74WyncuVrnurlmIRxaHL8YK+LI1Kzq+/JM52IAkNnv4u+Q==", "peer": true, "dependencies": { "@babel/runtime": "^7.23.9" @@ -6563,9 +6564,9 @@ "integrity": "sha512-N8tkAACJx2ww8vFMneJmaAgmjAG1tnVBZJRLRcx061tmsLRZHSEZSLuGWnwPtunsSLvSqXQ2wfp7Mgqg1I+2dQ==" }, "node_modules/@xstate/react": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@xstate/react/-/react-4.1.1.tgz", - "integrity": "sha512-pFp/Y+bnczfaZ0V8B4LOhx3d6Gd71YKAPbzerGqydC2nsYN/mp7RZu3q/w6/kvI2hwR/jeDeetM7xc3JFZH2NA==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@xstate/react/-/react-4.1.2.tgz", + "integrity": "sha512-orAidFrKCrU0ZwN5l/ABPlBfW2ziRDT2RrYoktRlZ0WRoLvA2E/uAC1JpZt43mCLtc8jrdwYCgJiqx1V8NvGTw==", "peer": true, "dependencies": { "use-isomorphic-layout-effect": "^1.1.2", @@ -6573,7 +6574,7 @@ }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "xstate": "^5.11.0" + "xstate": "^5.18.1" }, "peerDependenciesMeta": { "xstate": { @@ -12085,6 +12086,11 @@ "pend": "~1.2.0" } }, + "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/figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -17626,9 +17632,9 @@ } }, "node_modules/jquery": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.0.tgz", - "integrity": "sha512-umpJ0/k8X0MvD1ds0P9SfowREz2LenHsQaxSohMZ5OMNEU2r0tf8pdeEFTHMFxWVxKNyU9rTtK3CWzUCTKJUeQ==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", "peer": true }, "node_modules/js-cookie": { @@ -20908,6 +20914,25 @@ "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, + "node_modules/posthog-js": { + "version": "1.161.6", + "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.161.6.tgz", + "integrity": "sha512-UO0z/YTuan55Kl5Yg9Xs5x1PKUkm2zGKUNPioznb4GLRcxFnLBkWoeKQXNro2YZsYJvK+MY8jlF3cdGa8BZ8/Q==", + "dependencies": { + "fflate": "^0.4.8", + "preact": "^10.19.3", + "web-vitals": "^4.0.1" + } + }, + "node_modules/posthog-js/node_modules/preact": { + "version": "10.24.0", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.24.0.tgz", + "integrity": "sha512-aK8Cf+jkfyuZ0ZZRG9FbYqwmEiGQ4y/PUO4SuTWoyWL244nZZh7bd5h2APd4rSNDYTBNghg1L+5iJN3Skxtbsw==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, "node_modules/preact": { "version": "10.12.1", "resolved": "https://registry.npmjs.org/preact/-/preact-10.12.1.tgz", @@ -25478,9 +25503,9 @@ } }, "node_modules/typescript": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", - "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", "peer": true, "bin": { "tsc": "bin/tsc", @@ -26294,6 +26319,11 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/web-vitals": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-4.2.3.tgz", + "integrity": "sha512-/CFAm1mNxSmOj6i0Co+iGFJ58OS4NRGVP+AWS/l509uIK5a1bSoIVaHz/ZumpHTfHSZBpgrJ+wjfpAOrTHok5Q==" + }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -26854,9 +26884,9 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, "node_modules/xstate": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/xstate/-/xstate-5.14.0.tgz", - "integrity": "sha512-3c1H8dzebSODUSY1vM86zIE3Eg+VFzElvhklaF/ZTN5K2i6HsLc4j38qn9+TF2mHPTUFXrOn4M0Cxw9m63upLA==", + "version": "5.18.1", + "resolved": "https://registry.npmjs.org/xstate/-/xstate-5.18.1.tgz", + "integrity": "sha512-m02IqcCQbaE/kBQLunwub/5i8epvkD2mFutnL17Oeg1eXTShe1sRF4D5mhv1dlaFO4vbW5gRGRhraeAD5c938g==", "peer": true, "funding": { "type": "opencollective", diff --git a/package.json b/package.json index a33f3fe6d733..f87971351503 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ "lodash": "^4.17.21", "mui-datatables": "^4.3.0", "path-browserify": "^1.0.1", + "posthog-js": "^1.161.6", "prism-react-renderer": "^1.3.5", "process": "^0.11.10", "prop-types": "^15.7.2",