Skip to main content
Answered

Intercom2 not a function error with messenger sdk

  • July 8, 2024
  • 1 reply
  • 183 views

EDIT: I’m silly and missed the most obvious thing. Turns out the import is different for Remix apps.

import should be this:
import {Intercom} from '@intercom/messenger-js-sdk';

I’m embedding the an Intercom messenger onto a Remix (react) app. Just following along with the installation instructions it states that I should place this snippet in the client side code of the Component. I’ve done this so far, the snippet looking like this:

import Intercom from '@intercom/messenger-js-sdk';
 
export default function Home() {
        Intercom({
            app_id: 'app-id-here',
            user_id: …,
            name: …,
            email: …,
            created_at:
        });
    
    return(

        <h1>Test Component</h1>
    )
}

However, when this component is rendered on the page, it causes this error to be thrown:
TypeError: Intercom2 is not a function

I cant seem to find a reason for this besides something from the Intercom function not working correctly
Any advice would be helpful. Thank you!

Best answer by mateusz.leszkiewicz

Hi Sam Walkerz It’s Mat from the Support Engineering Team 😀

It looks like there is an issue with the implementation of the installation snippet into the app.

I would highly recommend looking at this guide on installing Intercom in web.

We also have a brand new way of installing Intercom via NodeJS.

Please let me know if you have any questions about this 😸

View original
Did this topic help you find an answer to your question?

1 reply

mateusz.leszkiewicz
Intercom Team
Forum|alt.badge.img+5

Hi Sam Walkerz It’s Mat from the Support Engineering Team 😀

It looks like there is an issue with the implementation of the installation snippet into the app.

I would highly recommend looking at this guide on installing Intercom in web.

We also have a brand new way of installing Intercom via NodeJS.

Please let me know if you have any questions about this 😸


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings