
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
intercom-client
Advanced tools
[](https://github.com/fern-api/fern) [](https://www.npmjs.com/package/intercom-client)
The Intercom TypeScript library provides convenient access to the Intercom API from TypeScript.
The Intercom team is excited to announce a new and improved TypeScript SDK, currently available as an alpha
version. Check out the
API reference here.
During this time, we hope to gather feedback from the Intercom community to help drive the direction of the latest API changes.
Please feel free to leave in any suggestions in our open GitHub discussion to improve the experience for everyone!
npm i -s intercom-client@alpha
Instantiate and use the client with the following:
import { IntercomClient, Intercom } from "intercom-client";
const client = new IntercomClient({ token: "YOUR_TOKEN" });
await client.articles.create({
title: "Thanks for everything",
description: "Description of the Article",
body: "Body of the Article",
author_id: 1295,
state: Intercom.CreateArticleRequestState.Published,
});
The SDK exports all request and response types as TypeScript interfaces. Simply import them with the following namespace:
import { Intercom } from "intercom-client";
const request: Intercom.AdminsAwayRequest = {
...
};
List endpoints are paginated. The SDK provides an iterator so that you can simply loop over the items:
const result = await client.companies.list();
for await (const company of result) {
console.log(company.id);
}
You can also iterate page-by-page:
let page = await client.companies.list();
for (const company of page.data) {
console.log(company.id);
}
or manually:
while (page.hasNextPage()) {
page = page.getNextPage();
// ...
}
When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error will be thrown.
import { IntercomError } from "intercom-client";
try {
await client.articles.create(...);
} catch (err) {
if (err instanceof IntercomError) {
console.log(err.statusCode);
console.log(err.message);
console.log(err.body);
}
}
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long as the request is deemed retriable and the number of retry attempts has not grown larger than the configured retry limit (default: 2).
A request is deemed retriable when any of the following HTTP status codes is returned:
Use the maxRetries
request option to configure this behavior.
const response = await client.articles.create(..., {
maxRetries: 0 // override maxRetries at the request level
});
The SDK defaults to a 60 second timeout. Use the timeoutInSeconds
option to configure this behavior.
const response = await client.articles.create(..., {
timeoutInSeconds: 30 // override timeout to 30s
});
The SDK allows users to abort requests at any point by passing in an abort signal.
const controller = new AbortController();
const response = await client.articles.create(..., {
abortSignal: controller.signal
});
controller.abort(); // aborts the request
The SDK defaults to node-fetch
but will use the global fetch client if present. The SDK works in the following
runtimes:
The SDK provides a way for your to customize the underlying HTTP client / Fetch function. If you're running in an unsupported environment, this provides a way for you to break glass and ensure the SDK works.
import { IntercomClient } from "intercom-client";
const client = new IntercomClient({
...
fetcher: // provide your implementation here
});
While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!
On the other hand, contributions to the README are always very welcome!
FAQs
Official Node bindings to the Intercom API
The npm package intercom-client receives a total of 149,058 weekly downloads. As such, intercom-client popularity was classified as popular.
We found that intercom-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.