diff --git a/frontend/src/components/hosted/AppContainer.tsx b/frontend/src/components/hosted/AppContainer.tsx index ea81e93..766660b 100644 --- a/frontend/src/components/hosted/AppContainer.tsx +++ b/frontend/src/components/hosted/AppContainer.tsx @@ -9,7 +9,6 @@ import AvatarDropdown from "./AvatarDropdown"; import { UserResponse } from "./types"; import { POSTHOG_HOST, POSTHOG_KEY, SAAS_BACKEND_URL } from "../../config"; import LandingPage from "./LandingPage"; -// import { loadCrispChat } from "../../lib/crisp"; import Intercom from "@intercom/messenger-js-sdk"; function AppContainer() { @@ -61,10 +60,6 @@ function AppContainer() { last_name: user.last_name, }); - // Initialize Crisp Chat - // loadCrispChat(); - // window.$crisp.push(["set", "user:email", [user.email]]); - setSubscriberTier(user.subscriber_tier); } diff --git a/frontend/src/config.ts b/frontend/src/config.ts index dad5ad9..b980304 100644 --- a/frontend/src/config.ts +++ b/frontend/src/config.ts @@ -28,6 +28,3 @@ export const IS_FREE_TRIAL_ENABLED = false; // PostHog export const POSTHOG_KEY = import.meta.env.VITE_POSTHOG_KEY || null; export const POSTHOG_HOST = import.meta.env.VITE_POSTHOG_HOST || null; - -// Crisp -export const CRISP_WEBSITE_ID = import.meta.env.VITE_CRISP_WEBSITE_ID || null; diff --git a/frontend/src/lib/crisp.ts b/frontend/src/lib/crisp.ts deleted file mode 100644 index 25fba31..0000000 --- a/frontend/src/lib/crisp.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { CRISP_WEBSITE_ID } from "../config"; - -export const loadCrispChat = (): (() => void) => { - if (document.getElementById("crisp-chat-script")) { - // The script element already exists, so don't add it again - return () => {}; - } - - window.$crisp = []; - window.CRISP_WEBSITE_ID = CRISP_WEBSITE_ID; - const d = document; - const s = d.createElement("script"); - s.src = "https://client.crisp.chat/l.js"; - s.async = true; - d.getElementsByTagName("head")[0].appendChild(s); - - return () => { - // Cleanup function to remove the script when it's no longer needed - const scriptElement = document.getElementById("crisp-chat-script"); - if (scriptElement && scriptElement.parentNode) { - scriptElement.parentNode.removeChild(scriptElement); - } - }; -}; - -declare global { - interface Window { - // Crisp - $crisp: unknown[]; // TODO: Replace with better type - CRISP_WEBSITE_ID: string; - } -}