From 29978828a45d2459eb2236a7ed44dac17e7ef069 Mon Sep 17 00:00:00 2001 From: Abi Raja Date: Wed, 5 Jun 2024 14:20:37 -0400 Subject: [PATCH] add help scout support chat for Pro users --- frontend/index.html | 26 +++++++++++++++++++ frontend/src/components/PicoBadge.tsx | 4 +-- .../src/components/hosted/AppContainer.tsx | 7 +++++ frontend/src/help-scout.d.ts | 11 ++++++++ 4 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 frontend/src/help-scout.d.ts diff --git a/frontend/index.html b/frontend/index.html index 39cfccc..0cfd965 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -16,6 +16,32 @@ <%- injectHead %> + + + Screenshot to Code diff --git a/frontend/src/components/PicoBadge.tsx b/frontend/src/components/PicoBadge.tsx index d7dfe9d..f5d173d 100644 --- a/frontend/src/components/PicoBadge.tsx +++ b/frontend/src/components/PicoBadge.tsx @@ -6,7 +6,7 @@ export function PicoBadge() {
- @@ -16,7 +16,7 @@ export function PicoBadge() { > feedback - + */} ); } diff --git a/frontend/src/components/hosted/AppContainer.tsx b/frontend/src/components/hosted/AppContainer.tsx index 20b11a3..5e2040a 100644 --- a/frontend/src/components/hosted/AppContainer.tsx +++ b/frontend/src/components/hosted/AppContainer.tsx @@ -59,6 +59,13 @@ function AppContainer() { last_name: user.last_name, }); + // Initialize Help Scout Beacon + window.Beacon("init", "8bcd8d6f-f25d-4339-8f49-703b9f165cdc"); + window.Beacon("identify", { + name: user.first_name + " " + user.last_name, + email: user.email, + }); + setSubscriberTier(user.subscriber_tier); } diff --git a/frontend/src/help-scout.d.ts b/frontend/src/help-scout.d.ts new file mode 100644 index 0000000..f831c04 --- /dev/null +++ b/frontend/src/help-scout.d.ts @@ -0,0 +1,11 @@ +// help-scout.d.ts +type Beacon = (eventName: string, options?: any) => void; + +// Extend the Window interface to include the `plausible` function +declare global { + interface Window { + Beacon: Beacon; + } +} + +export {};