nhagen / react-intercom

A component to configure and enable Intercom in your react application
MIT License
237 stars 72 forks source link

window.intercom("update") not working #96

Closed Reenagrg100 closed 1 year ago

Reenagrg100 commented 1 year ago

Hi, I'm using the intercom for my react application and I have a use case where I want to update some parameter whenever a user is logged in. I'm using the following steps:-

  1. on app start:- window.intercomSettings = { app_id: INTERCOM_APP_ID }
  2. Then on login:-

        await window.Intercom("boot", {
            user_id: response.user_state?.externalKey
        })
    
        await window.Intercom("trackEvent", "test1")
    
        await window.Intercom("update", {
            user_id: response.user_state?.externalKey,
            custom_attributes: {
                loggedInVia: "web"
            }
        })

Doing the following steps:-

However, my event "test1" is being logged on intercom with the corresponding user ( with which I logged in ). It means "boot" is working fine.

But in the next line when I'm trying to update the "loggedinVia" attribute it's not getting updated.