support intercom for all users
This commit is contained in:
parent
549210dcd4
commit
0171ff9f3b
@ -15,6 +15,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@clerk/clerk-react": "^4.29.0",
|
"@clerk/clerk-react": "^4.29.0",
|
||||||
"@codemirror/lang-html": "^6.4.6",
|
"@codemirror/lang-html": "^6.4.6",
|
||||||
|
"@intercom/messenger-js-sdk": "^0.0.11",
|
||||||
"@radix-ui/react-accordion": "^1.1.2",
|
"@radix-ui/react-accordion": "^1.1.2",
|
||||||
"@radix-ui/react-alert-dialog": "^1.0.5",
|
"@radix-ui/react-alert-dialog": "^1.0.5",
|
||||||
"@radix-ui/react-avatar": "^1.0.4",
|
"@radix-ui/react-avatar": "^1.0.4",
|
||||||
|
|||||||
@ -9,7 +9,8 @@ import AvatarDropdown from "./AvatarDropdown";
|
|||||||
import { UserResponse } from "./types";
|
import { UserResponse } from "./types";
|
||||||
import { POSTHOG_HOST, POSTHOG_KEY, SAAS_BACKEND_URL } from "../../config";
|
import { POSTHOG_HOST, POSTHOG_KEY, SAAS_BACKEND_URL } from "../../config";
|
||||||
import LandingPage from "./LandingPage";
|
import LandingPage from "./LandingPage";
|
||||||
import { loadCrispChat } from "../../lib/crisp";
|
// import { loadCrispChat } from "../../lib/crisp";
|
||||||
|
import Intercom from "@intercom/messenger-js-sdk";
|
||||||
|
|
||||||
function AppContainer() {
|
function AppContainer() {
|
||||||
const { isSignedIn, isLoaded } = useUser();
|
const { isSignedIn, isLoaded } = useUser();
|
||||||
@ -61,8 +62,16 @@ function AppContainer() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Initialize Crisp Chat
|
// Initialize Crisp Chat
|
||||||
loadCrispChat();
|
// loadCrispChat();
|
||||||
window.$crisp.push(["set", "user:email", [user.email]]);
|
// window.$crisp.push(["set", "user:email", [user.email]]);
|
||||||
|
|
||||||
|
// Initialize Intercom
|
||||||
|
Intercom({
|
||||||
|
app_id: "c5eiaj9m",
|
||||||
|
user_id: user.email,
|
||||||
|
name: user.first_name,
|
||||||
|
email: user.email,
|
||||||
|
});
|
||||||
|
|
||||||
setSubscriberTier(user.subscriber_tier);
|
setSubscriberTier(user.subscriber_tier);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -919,6 +919,11 @@
|
|||||||
resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz"
|
resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz"
|
||||||
integrity sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==
|
integrity sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==
|
||||||
|
|
||||||
|
"@intercom/messenger-js-sdk@^0.0.11":
|
||||||
|
version "0.0.11"
|
||||||
|
resolved "https://registry.yarnpkg.com/@intercom/messenger-js-sdk/-/messenger-js-sdk-0.0.11.tgz#ffdf37891826296d514a496e13a8d07e3d101c7e"
|
||||||
|
integrity sha512-jBHXO2+cGoBHYQMPaLP8eUm4AREcTWXlfd9shlBLSyEkFuW8+So/ynUDlftvWYz81KvGohRWYauw6vLRH/AlfA==
|
||||||
|
|
||||||
"@istanbuljs/load-nyc-config@^1.0.0":
|
"@istanbuljs/load-nyc-config@^1.0.0":
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced"
|
resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user