Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/intercom-performance-tuning

@0d57af8
Run it yourself

Optimize Intercom API performance with caching, search optimization, and pagination. Use when experiencing slow API responses, implementing caching strategies, or optimizing request throughput for Intercom integrations. Trigger with phrases like "intercom performance", "optimize intercom", "intercom latency", "intercom caching", "intercom slow", "intercom pagination".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/intercom-performance-tuning

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesexamples.md

≈678 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Intercom Performance Tuning — Worked Examples

End-to-end usage patterns that combine the techniques from references/implementation.md.

Example 1: Cached single-contact lookup

Read-through cache: first call hits the API, subsequent calls within the TTL are served from memory.

async function getContact(contactId: string): Promise<Intercom.Contact> {
  const cached = contactCache.get(contactId);
  if (cached) return cached;

  const contact = await client.contacts.find({ contactId });
  contactCache.set(contactId, contact);
  return contact;
}

Example 2: Narrow search instead of a broad scan

The BAD form pulls up to 150 unfiltered rows per page; the GOOD form pushes the predicate into the query so the API returns only the 25 rows you actually need.

// BAD: Overly broad search, fetching too many results
const allUsers = await client.contacts.search({
  query: { field: "role", operator: "=", value: "user" },
  pagination: { per_page: 150 },  // Max is 150
});

// GOOD: Targeted search with specific filters
const recentPro = await client.contacts.search({
  query: {
    operator: "AND",
    value: [
      { field: "role", operator: "=", value: "user" },
      { field: "custom_attributes.plan", operator: "=", value: "pro" },
      { field: "last_seen_at", operator: ">", value: Math.floor(Date.now() / 1000) - 86400 },
    ],
  },
  pagination: { per_page: 25 },
  sort: { field: "last_seen_at", order: "descending" },
});

Example 3: Stream and batch-process every contact

Cursor pagination keeps memory flat over an unbounded contact list, and the batch processor flushes work in fixed-size chunks.

const total = await processContactsInBatches(
  client,
  async (contacts) => {
    // e.g. enrich, export, or re-index each batch
    await exportToWarehouse(contacts);
  },
  100
);
console.log(`Processed ${total} contacts`);

Example 4: Parallel batch lookup with rate awareness

Resolve many contact IDs concurrently while respecting the rate limit via p-queue, checking the cache before each network call.

const ids = ["abc123", "def456", "ghi789"];
const contacts = await getContactsBatch(client, ids);

for (const [id, contact] of contacts) {
  console.log(id, contact.email);
}

Example 5: Wrap any call in latency instrumentation

measuredCall emits a structured JSON metric line per call so you can chart P50/P95 against the baselines in SKILL.md.

const contact = await measuredCall("contacts.find", () =>
  client.contacts.find({ contactId: "abc123" })
);
// → {"metric":"intercom.api.call","operation":"contacts.find","duration_ms":84,"status":"success"}

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    This skill provides legitimate code implementations and best practices for optimizing Intercom API performance, including caching, search optimization, and rate-aware pagination. It follows security best practices for secret management.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: MEDIUM · 1 issue

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 months ago
What it can do
Reads files Edits files
version
1.6.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "saas",
  "support",
  "messaging",
  "intercom"
]
All 3 allowed tools
ReadWriteEdit
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/intercom-performance-tuning