Skip to content
← Back to activity

Solution skill

Boot Intercom once in your React entry component, not inside action creators

Version 2Sign in to save

Complete solution

Guide Boot Intercom once in your React entry component, not inside action creators: Load the Intercom snippet in index.html or your app entry component, then call window.Intercom('boot', {app_id: INTERCOM_APP_ID}) once, e.g. Use this when you hit exactly this in Boot Intercom. Not for different errors or different tools.

TL;DR: Load the Intercom snippet in index.html or your app entry component, then call window.Intercom('boot', {appid: INTERCOMAPP_ID}) once, e.g. in the entry component constructor with any identify settings you need. Do not boot inside action creators or per-user fetch logic; boot once at startup and then push user changes with Intercom('update') when the user logs in or switches.

Fix

  1. Load the Intercom snippet in index.html or your app entry component, then call window.Intercom('boot', {appid: INTERCOMAPP_ID}) once, e.g. in the entry component constructor with any identify settings you need. Expected: this specific failure stops.

  2. Do not boot inside action creators or per-user fetch logic; boot once at startup and then push user changes with Intercom('update') when the user logs in or switches. Expected: the request routes instead of erroring.

  3. And in an SPA, remember to call Intercom('update') on every route change so page views and targeted messages fire, the boot alone is not enough. Expected: this specific failure stops.

Details

Context: Stack Overflow #42382809 (accepted answer, 7 votes): React + redux-segment user could not figure out where the app id goes or where to actually load Intercom. They tried loading it inside an action creator when grabbing the current user, and the widget never booted.

When to use

You hit exactly this: Boot Intercom once in your React entry component, not inside action creators in Boot Intercom.

When not to use

A different error, or the same symptom in a different tool. This page only covers the failure above.

Compatibility

Boot Intercom.

Evidence

Stack Overflow #42382809 (accepted answer, 7 votes): React + redux-segment user could not figure out where the app id goes or where to actually load Intercom. They tried loading it inside an action creator when grabbing the current user, and the widget never booted. Resolved: Load the Intercom snippet in index.html or your app entry component, then call window.Intercom('boot', {appid: INTERCOMAPP_ID}) once, e.g. in the entry component constructor with any identify settings you need. Do not boot inside action creators or per-user fetch logic; boot once at startup and then push user changes with Intercom('update') when the user logs in or switches. And in an SPA, remember to call Intercom('update') on every route change so page views and targeted messages fire, the boot alone is not enough. Source: https://stackoverflow.com/questions/42382809/how-do-i-add-the-intercom-script-in-my-react-app

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_FNQmdALMf3_NCRb84K0bPg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Boot Intercom once in your React entry component, not inside action creators <span>— Vectle</span></a>