---
name: intercom-upgrade-migration
description: |-
  Upgrade the intercom-client SDK across major versions and handle Intercom API
  version changes safely. Use when a project is pinned to an old intercom-client
  release, when the v5 CommonJS API must move to the v6 TypeScript rewrite, or
  when detecting breaking changes in a new Intercom release before shipping.
  Trigger with phrases like "upgrade intercom", "intercom migration",
  "intercom breaking changes", "update intercom SDK", "intercom API version".
allowed-tools: Read, Write, Edit, Bash(npm:*), Bash(git:*)
version: 1.6.0
license: MIT
author: Jeremy Longshore <jeremy@intentsolutions.io>
argument-hint: "[current-version] [target-version]"
tags:
  - saas
  - support
  - messaging
  - intercom
compatibility: Designed for Claude Code
title: intercom-upgrade-migration
canonical_url: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/intercom-upgrade-migration
last_updated: 2026-10-07T06:06:28.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/examples.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-upgrade-migration/references/examples.md), [references/migration-guide.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-upgrade-migration/references/migration-guide.md).
>
> If the user asked to install this Skill, run `npx skilld install jeremylongshore/tons-of-skills-marketplace/intercom-upgrade-migration`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/intercom-upgrade-migration`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/jeremylongshore/tons-of-skills-marketplace/intercom-upgrade-migration) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/intercom-upgrade-migration`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/intercom-upgrade-migration --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/intercom-upgrade-migration --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Intercom Upgrade & Migration

## Overview

Upgrade the `intercom-client` npm package and handle Intercom API version
changes without breaking production traffic. The v6 TypeScript rewrite changed
the API surface — most notably unifying `users`/`leads` into a single `contacts`
API — so this skill drives a branch-based, type-checked upgrade that surfaces
every breaking change through the compiler and test suite before merge.

Deep material lives in `references/` so this file stays scannable:

- [Full v5 → v6 migration guide](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-upgrade-migration/references/migration-guide.md) — every changed
  operation with before/after code, API-version pinning, the upgrade procedure,
  type-import changes, and the method cheat sheet.
- [Worked examples](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-upgrade-migration/references/examples.md) — three end-to-end runs from version
  detection through a committed upgrade branch.

## Prerequisites

- A project with `intercom-client` already installed (`npm list intercom-client`
  shows the current version).
- Git available for branch-based upgrades and reviewable diffs.
- A working test suite, ideally including an integration suite that can run
  against a dev Intercom workspace.
- TypeScript (`tsc`) configured if migrating to v6+, since the compiler is the
  primary breaking-change detector.

## Authentication

Intercom API calls authenticate with a workspace access token passed as a Bearer
token. Read it from the `INTERCOM_ACCESS_TOKEN` environment variable — never
hardcode it. Version-detection curls and the integration test step both consume
this variable:

```bash
export INTERCOM_ACCESS_TOKEN="<workspace-access-token>"   # from Intercom > Developer Hub
```

Use a separate dev-workspace token (`$DEV_TOKEN`) for the integration test step
so the upgrade is validated without touching production data.

## Instructions

Follow the workflow at a high level here; drill into
[the migration guide](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-upgrade-migration/references/migration-guide.md) for the exact code diffs.

### Step 1: Check current versions

Read (with the `Read` tool or `npm list`) the installed version, the latest
published version, and the live API version to size the upgrade:

```bash
npm list intercom-client                  # installed SDK version
npm view intercom-client version          # latest available
curl -s -D - -o /dev/null \
  -H "Authorization: Bearer $INTERCOM_ACCESS_TOKEN" \
  https://api.intercom.io/me 2>/dev/null | grep -i intercom-version
```

If the installed major is < 6 and the target is ≥ 6, expect the TypeScript-rewrite
breaking changes.

### Step 2: Migrate the code (v5 → v6)

For a major crossing, apply the breaking-change diffs with the `Edit`/`Write`
tools: swap `new Intercom.Client()` for `new IntercomClient()`, move
`users`/`leads` calls to the unified `contacts` API, rename positional params
(`id` → `contactId`/`conversationId`), and update error handling to the
`IntercomError` instance check. The full before/after set and a one-line-per-method
cheat sheet are in [the migration guide](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-upgrade-migration/references/migration-guide.md).

### Step 3: Pin the API version if needed

The SDK sends a compatible `Intercom-Version` header automatically. Pin it
explicitly only when using raw `fetch` requests or when a response shape must be
frozen — see the API-version-pinning section of the migration guide.

### Step 4: Run the type-checked upgrade on a branch

Do the whole upgrade on a dedicated branch so TypeScript and the tests gate it:

```bash
git checkout -b upgrade/intercom-client-v6
npm install intercom-client@latest
npx tsc --noEmit 2>&1 | grep "intercom"    # surfaces every breaking change
npm test
```

Fix each error the compiler reports, re-run until clean, then validate against a
dev workspace and commit. The complete procedure is in the migration guide.

## Output

Running this skill produces:

- A dedicated upgrade branch (e.g. `upgrade/intercom-client-v6`) with
  `intercom-client` bumped in `package.json` / lockfile.
- Source edits that migrate every v5 call site to the v6 API surface.
- A clean `npx tsc --noEmit` run (no remaining `intercom-client` type errors) and
  a green `npm test` / integration run against a dev workspace.
- A commit ready for PR, e.g. `chore: upgrade intercom-client to v6`.

## Error Handling

| Issue | Detection | Solution |
|-------|-----------|----------|
| `Cannot find module 'intercom-client'` | Import fails | `npm install intercom-client` |
| `Property 'users' does not exist` | TypeScript error | Migrate `users`/`leads` to `contacts` |
| `Property 'id' does not exist` | Changed param names | Use `contactId`, `conversationId` |
| Response shape changed | Runtime errors | Check API version headers, pin `Intercom-Version` |
| `401 Unauthorized` | curl/test fails | Verify `INTERCOM_ACCESS_TOKEN` is set and valid |

## Examples

Quick skeleton — detect, then migrate one call:

```bash
npm list intercom-client        # e.g. 5.4.0
npm view intercom-client version # e.g. 6.4.0 → major upgrade
```

```typescript
// v5  → migrate to →  v6
// await client.users.create({ email });
await client.contacts.create({ role: "user", email });
```

Three full end-to-end runs — version detection, a single-call migration, and a
complete branch upgrade — are in [references/examples.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-upgrade-migration/references/examples.md).

## Resources

- [intercom-node GitHub](https://github.com/intercom/intercom-node)
- [SDK v6 Release Notes](https://github.com/intercom/intercom-node/discussions/416)
- [API Versioning](https://developers.intercom.com/docs/references/introduction)
- [intercom-client npm](https://www.npmjs.com/package/intercom-client)

## Next Steps

After the upgrade branch is green, wire the version bump into CI so future
regressions are caught automatically — see the `intercom-ci-integration` skill
for the pipeline configuration.
