Skip to content

intercom: handle shutdown→boot race and relay through @intercom/messenger-js-sdk #10

@productdevbook

Description

@productdevbook

Biggest open pain in `devrnt/react-use-intercom` (376 ⭐, ~462k weekly) plus discussion about migrating to official `@intercom/messenger-js-sdk` (~999k weekly).

Evidence

Tasks

  • Internal listener registry that survives `shutdown` and re-binds on `boot`
  • `softReboot()` = `shutdown` + `boot` atomically (used during user switch)
  • `identify({ hash })` ⇒ maps to `user_hash` (classic) or `intercom_user_jwt` when `auth: "jwt"` config is set
  • Region-aware: `region: "us" | "eu" | "au"` ⇒ right `api_base`
  • Optional adapter mode that wraps `@intercom/messenger-js-sdk` underneath (delegate `Intercom()` to their typed helper)
  • Expose `onUnreadCountChange(count)` typed callback (replaces #479)
  • `isBooted` boolean + `ready: Promise`
  • `enabled` flag defaults to `process.env.NODE_ENV === 'production'`

Metadata

Metadata

Assignees

No one assigned

    Labels

    competitor-analysisDerived from OSS competitor issue patternsidentityidentify / HMAC / JWT / sessionlifecycleboot/shutdown/re-init/strict modeprovider:intercom

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions