/intercom-pack:intercom-sdk-patternsfrom intercom-pack
Applies production-ready intercom-client SDK patterns for TypeScript: type-safe singletons, cursor-based pagination, retry with backoff, compound search, and multi-tenant factories.
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.
Read when SKILL.md points to them.
Production-ready patterns for the intercom-client TypeScript SDK covering
client initialization, cursor-based pagination, error handling, retry with
backoff, compound search, and multi-tenant client factories. Use this skill to
Read existing Intercom code, then Write or Edit it to match these patterns —
type-safe singletons, memory-efficient pagination, and resilient error handling.
The SKILL.md body carries the essential skeletons (client wrapper, pagination,
error-handling shape). Deep implementations and worked examples live in
references/ so you can drill in only when you need them:
intercom-client package installed (npm install intercom-client).strict mode enabled.async/await and async generators.The SDK authenticates with a workspace access token passed to the
IntercomClient constructor. Store it in the INTERCOM_ACCESS_TOKEN environment
variable — never hardcode it. Generate the token from Intercom's Developer Hub
(Settings → Authentication). For multi-workspace apps, each workspace has its own
token; see the multi-tenant factory in
references/implementation.md.
Create one lazily-initialized singleton client plus thin, typed helpers. This keeps a single connection pool and gives every call-site full SDK types.
// src/intercom/client.ts
import { IntercomClient } from "intercom-client";
import { Intercom } from "intercom-client";
let instance: IntercomClient | null = null;
export function getClient(): IntercomClient {
if (!instance) {
instance = new IntercomClient({
token: process.env.INTERCOM_ACCESS_TOKEN!,
});
}
return instance;
}
// Type-safe contact creation helper
export async function createContact(
params: Intercom.CreateContactRequest
): Promise<Intercom.Contact> {
return getClient().contacts.create(params);
}
Intercom lists are cursor-paginated — starting_after points to the next page.
Prefer the SDK's built-in async iteration, which manages the cursor for you:
const response = await client.articles.list();
for await (const article of response) {
console.log(article.title);
}
When explicit control is needed, an alternative option is a custom generator
that yields each item and advances startingAfter until the cursor is
exhausted. Choose auto-iteration for simplicity, or the manual generator when a
custom perPage, early exit, or per-page side effects are required. Both
variants: references/examples.md.
Wrap every call so a thrown IntercomError becomes a normalized
{ data, error } result, then layer retry/backoff on transient failures (429,
5xx). Skeleton:
import { IntercomError } from "intercom-client";
try {
const data = await client.contacts.find({ contactId: "abc123" });
// use data
} catch (err) {
if (err instanceof IntercomError) {
// inspect err.statusCode (401/404/409/422/429), err.body?.errors
}
throw err; // re-throw non-Intercom errors
}
Full safeIntercomCall wrapper, withRetry exponential-backoff helper (with
Retry-After support), and compound search live in
references/implementation.md.
Applying this skill produces TypeScript source that follows these patterns:
src/intercom/client.ts) exporting getClient
and typed helpers.safeIntercomCall returning { data, error }, with
withRetry applied to rate-limited and server-error responses.INTERCOM_ACCESS_TOKEN (or a per-workspace
token via the factory).| Pattern | Use Case | Benefit |
|---|---|---|
safeIntercomCall wrapper | All API calls | Prevents uncaught exceptions |
withRetry | Transient failures (429, 5xx) | Automatic recovery |
| Cursor pagination generator | Large data sets | Memory-efficient streaming |
| Client factory | Multi-tenant apps | Workspace isolation |
Status codes to handle explicitly: 401 (bad/expired token), 404 (missing
resource), 409 (conflict/duplicate), 422 (validation — check
err.body?.errors), 429 (rate limited — back off). Full switch-based handler:
references/implementation.md.
withRetry composed with safeIntercomCall:
references/examples.md.Minimal end-to-end shape:
import { getClient } from "./intercom/client";
const client = getClient();
const contact = await client.contacts.create({
role: "user",
email: "[email protected]",
});
console.log(contact.id);
Apply these patterns alongside intercom-core-workflow-a for contact management
workflows. For the full implementation catalog and worked examples, open
references/implementation.md and
references/examples.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
24 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-core-workflow-aManage Intercom contacts: create, search, update, merge leads into users.
Use when building contact management features, syncing user data, or implementing contact search and segmentation against the Intercom REST API.
Trigger with phrases like "intercom contacts", "intercom users", "intercom leads", "create intercom contact", "search intercom contacts", "merge intercom lead".
/intercom-core-workflow-bManage Intercom conversations: create, reply, close, snooze, assign, and tag.
Use when building conversation management features, automating replies,
or implementing support workflow automation.
Trigger with phrases like "intercom conversations", "intercom reply",
"intercom assign conversation", "intercom close conversation",
"intercom snooze", "manage intercom conversations".
/intercom-cost-tuningOptimize Intercom API costs through caching, request reduction, and usage monitoring.
Use when analyzing Intercom API usage, reducing unnecessary requests,
or implementing usage tracking and budget awareness.
Trigger with phrases like "intercom cost", "intercom billing",
"reduce intercom requests", "intercom pricing", "intercom usage", "intercom budget".
/intercom-data-handlingImplement Intercom data handling for GDPR, contact export, data retention, and PII.
Use when handling sensitive Intercom contact data, fulfilling a data subject access or deletion request, redacting PII in logs, or setting retention policy for cached Intercom records.
Trigger with phrases like "intercom data", "intercom PII",
"intercom GDPR", "intercom data retention", "intercom privacy", "intercom CCPA",
"intercom data export", "intercom delete contact".
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin intercom-packOther plugins' skills for the same job