-
Notifications
You must be signed in to change notification settings - Fork 127
Integrate Intercom SDK for helpdesk functionality #675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Integrate Intercom SDK for helpdesk functionality #675
Conversation
""" WalkthroughThe changes replace the Freshworks support widget integration with the Intercom Messenger SDK in the web server project. This includes updating dependencies, initializing Intercom in the app head, and modifying the helpdesk prefill functionality to use Intercom for error reporting instead of Freshworks. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AppHead
participant IntercomSDK
User->>AppHead: Loads application
AppHead->>IntercomSDK: Initialize with App ID
Note right of IntercomSDK: Intercom Messenger loaded
User->>SomethingWentWrong: Encounters error
SomethingWentWrong->>IntercomSDK: showNewMessage(error details)
IntercomSDK->>User: Opens Intercom Messenger with error message
Poem
""" 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
web-server/src/components/AppHead.tsx (1)
13-32
: Potential issue: Intercom may initialize multiple times.The Intercom initialization is inside a useEffect with dependencies that may cause it to re-run when the router changes. This could lead to multiple initializations of the Intercom widget.
Consider moving the Intercom initialization to a separate useEffect with an empty dependency array:
useEffect(() => { const isDev = process.env.NEXT_PUBLIC_APP_ENVIRONMENT === 'development'; - Intercom({ - app_id: 'kckm1m2e' - }); + }, [router.asPath, router.events, router.isReady, router.pathname]); + + useEffect(() => { + Intercom({ + app_id: process.env.NEXT_PUBLIC_INTERCOM_APP_ID || 'kckm1m2e' + }); + }, []); + + useEffect(() => { + const isDev = process.env.NEXT_PUBLIC_APP_ENVIRONMENT === 'development'; if (!isDev) { const onFocus = () => track('WINDOW_FOCUS'); const onBlur = () => track('WINDOW_BLUR'); const onUnload = () => track('WINDOW_UNLOAD'); window.addEventListener('focus', onFocus); window.addEventListener('blur', onBlur); window.addEventListener('beforeunload', onUnload); return () => { window.removeEventListener('focus', onFocus); window.removeEventListener('blur', onBlur); window.removeEventListener('beforeunload', onUnload); }; } }, [router.asPath, router.events, router.isReady, router.pathname]);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
web-server/yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (3)
web-server/package.json
(1 hunks)web-server/src/components/AppHead.tsx
(2 hunks)web-server/src/components/SomethingWentWrong/SomethingWentWrong.tsx
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: All file linting
🔇 Additional comments (2)
web-server/package.json (1)
18-18
: Confirm @intercom/messenger-js-sdk version and beta statusThe dependency in web-server/package.json (line 18):
"@intercom/messenger-js-sdk": "^0.0.14",
is indeed the latest published release—but it’s still classified as a beta (0.0.x) with no non-beta version available.
Before proceeding, please ensure you’re comfortable with the implications of a beta SDK:
- Pin the dependency to an exact version (e.g.
"0.0.14"
) if you need to avoid unintended minor bumps.- Add integration or end-to-end tests around any Intercom interactions to catch breaking changes early.
- Monitor the package’s changelog or GitHub issues for upcoming API changes or security advisories.
web-server/src/components/SomethingWentWrong/SomethingWentWrong.tsx (1)
1-1
: Good implementation approach for replacing Freshworks with Intercom.The import and usage of
showNewMessage
aligns well with the overall migration strategy.
web-server/src/components/SomethingWentWrong/SomethingWentWrong.tsx
Outdated
Show resolved
Hide resolved
…and environment check
2025-07-16.18-59-40.mp4
Integrate the Intercom SDK to enhance helpdesk prefill functionality, replacing the previous Freshworks integration with the new messaging feature.
Summary by CodeRabbit
New Features
Chores