/intercom-pack:intercom-upgrade-migrationfrom intercom-pack
Guides upgrading intercom-client npm SDK from v5 to v6+ (TypeScript rewrite) and handling Intercom API version changes. Covers client init, unified contacts API, conversation replies, error handling, and pagination.
Ships in intercom-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Guide for upgrading the intercom-client npm package and handling Intercom API version changes. The SDK was rewritten in TypeScript starting at v6, which introduced significant breaking changes from the v5 CommonJS API.
intercom-client installed# Current SDK version
npm list intercom-client
# Latest available
npm view intercom-client version
# Current API version (check response headers)
curl -s -D - -o /dev/null \
-H "Authorization: Bearer $INTERCOM_ACCESS_TOKEN" \
https://api.intercom.io/me 2>/dev/null | grep -i intercom-version
The v6 SDK is a full TypeScript rewrite with a new API surface.
Client Initialization:
// v5 (CommonJS)
const Intercom = require("intercom-client");
const client = new Intercom.Client({ token: "xxx" });
// v6+ (TypeScript ESM)
import { IntercomClient } from "intercom-client";
const client = new IntercomClient({ token: "xxx" });
Contact Operations:
// v5
await client.users.create({ email: "[email protected]" });
await client.leads.create({ email: "[email protected]" });
await client.users.find({ id: "abc" });
await client.users.list();
// v6+ (unified contacts API)
await client.contacts.create({ role: "user", email: "[email protected]" });
await client.contacts.create({ role: "lead", email: "[email protected]" });
await client.contacts.find({ contactId: "abc" });
await client.contacts.list();
Conversation Operations:
// v5
await client.conversations.reply({ id: "123", body: "Hello", type: "admin", admin_id: "456" });
// v6+
await client.conversations.reply({
conversationId: "123",
body: "Hello",
type: "admin",
adminId: "456",
});
Error Handling:
// v5
try { ... } catch (e) { console.log(e.statusCode, e.body); }
// v6+
import { IntercomError } from "intercom-client";
try { ... } catch (e) {
if (e instanceof IntercomError) {
console.log(e.statusCode, e.message, e.body);
}
}
Pagination:
// v5 - callback style
client.users.scroll.each({}, (users) => { /* ... */ });
// v6+ - async iteration
const response = await client.contacts.list();
for await (const contact of response) {
// Auto-paginates
}
// Or manual cursor-based pagination
let startingAfter: string | undefined;
do {
const page = await client.contacts.list({ perPage: 50, startingAfter });
// process page.data
startingAfter = page.pages?.next?.startingAfter ?? undefined;
} while (startingAfter);
Intercom API versions control response shapes. The SDK defaults to a compatible version, but you can pin explicitly.
// Current stable version: 2.11
// SDK handles version headers automatically
// To use specific version via raw requests:
const response = await fetch("https://api.intercom.io/contacts", {
headers: {
Authorization: `Bearer ${token}`,
"Intercom-Version": "2.11",
"Content-Type": "application/json",
},
});
# 1. Create upgrade branch
git checkout -b upgrade/intercom-client-v6
# 2. Install new version
npm install intercom-client@latest
# 3. Run type checks (will surface breaking changes)
npx tsc --noEmit 2>&1 | grep "intercom"
# 4. Run tests
npm test
# 5. Fix breaking changes identified by TypeScript and tests
# 6. Test against dev workspace
INTERCOM_ACCESS_TOKEN=$DEV_TOKEN npm run test:integration
# 7. Commit and PR
git add -A && git commit -m "chore: upgrade intercom-client to v6"
// v6+ exports types under Intercom namespace
import { Intercom } from "intercom-client";
// Use typed request/response interfaces
const request: Intercom.CreateContactRequest = {
role: "user",
email: "[email protected]",
};
const contact: Intercom.Contact = await client.contacts.create(request);
| v5 Method | v6 Method |
|---|---|
client.users.create() | client.contacts.create({ role: "user" }) |
client.leads.create() | client.contacts.create({ role: "lead" }) |
client.users.find({ id }) | client.contacts.find({ contactId }) |
client.users.update({ id }) | client.contacts.update({ contactId }) |
client.users.list() | client.contacts.list() |
client.conversations.reply({ id }) | client.conversations.reply({ conversationId }) |
client.events.create() | client.dataEvents.create() |
client.tags.tag() | client.contacts.tag() |
new Intercom.Client({ token }) | new IntercomClient({ token }) |
e.statusCode | e instanceof IntercomError ? e.statusCode : ... |
| 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 |
For CI integration during upgrades, see intercom-ci-integration.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub flight505/skill-forge --plugin intercom-pack24 skills in this plugin
/intercom-ci-integrationConfigure CI/CD pipelines for Intercom integrations with GitHub Actions.
Use when setting up automated testing, configuring CI with Intercom secrets,
or integrating Intercom API tests into your build process.
Trigger with phrases like "intercom CI", "intercom GitHub Actions",
"intercom automated tests", "CI intercom", "intercom pipeline".
/intercom-common-errorsDiagnose and fix Intercom API errors by HTTP status code and error type.
Use when encountering Intercom errors, debugging failed API requests,
or troubleshooting integration issues.
Trigger with phrases like "intercom error", "fix intercom",
"intercom not working", "debug intercom", "intercom 401", "intercom 429".
/intercom-Other plugins' skills for the same job