diff --git a/frontend/components/analytics/posthog.js b/frontend/components/analytics/posthog.js index ce0fb461ae..5eda4de3a2 100644 --- a/frontend/components/analytics/posthog.js +++ b/frontend/components/analytics/posthog.js @@ -1,10 +1,11 @@ import posthog from "posthog-js"; +import { ENV, POSTHOG_API_KEY, POSTHOG_HOST, TELEMETRY_ENABLED } from "../utilities/config"; export const initPostHog = () => { if (typeof window !== "undefined") { - if (process.env.NEXT_PUBLIC_ENV == "production") { - posthog.init(process.env.NEXT_PUBLIC_POSTHOG_API_KEY, { - api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST, + if (ENV == "production" && TELEMETRY_ENABLED) { + posthog.init(POSTHOG_API_KEY, { + api_host: POSTHOG_HOST, }); } } diff --git a/frontend/components/basic/dialog/AddUserDialog.js b/frontend/components/basic/dialog/AddUserDialog.js index 4bb1b0c9f8..eeec682b38 100644 --- a/frontend/components/basic/dialog/AddUserDialog.js +++ b/frontend/components/basic/dialog/AddUserDialog.js @@ -3,6 +3,7 @@ import { Fragment } from "react"; import InputField from "../InputField"; import { useRouter } from "next/router"; import Button from "../buttons/Button"; +import { STRIPE_PRODUCT_STARTER } from "../../utilities/config"; const AddUserDialog = ({ isOpen, @@ -70,7 +71,7 @@ const AddUserDialog = ({ isRequired /> - {currentPlan == process.env.NEXT_PUBLIC_STRIPE_PRODUCT_STARTER &&
+ {currentPlan == STRIPE_PRODUCT_STARTER &&