Is the type of IntercomSettings.companies correct in @intercom/messenger-js-sdk | Community
Skip to main content
Question

Is the type of IntercomSettings.companies correct in @intercom/messenger-js-sdk

  • March 3, 2026
  • 0 replies
  • 2 views

Issue:

The TypeScript type definition for the companies property in the @intercom/messenger-js-sdk (v0.0.18) appears to be incorrectly defined as a single-item tuple rather than a standard array.

Details: In the SDK's type definitions, the companies property is defined as: companies?: [any];

In TypeScript, the [any] syntax defines a tuple of length 1. However, Intercom's own documentation and the actual JavaScript API support an array of multiple company objects.

The Error: When attempting to pass an array of multiple companies, the TypeScript compiler throws the following error:

TS2322: Type '{ name: string; company_id: string; }[]' is not assignable to type '[any]'. Target requires 1 element(s) but source may have fewer.

Steps to Reproduce: Try to boot the messenger with more than one company:

TypeScript

import { boot } from '@intercom/messenger-js-sdk';

const companies: { company_id: string; name: string }[] = [
{ company_id: '1', name: 'Company A' },
{ company_id: '2', name: 'Company B' },
];

boot({
app_id: 'your_app_id',
user_id: 'user_123',
companies,
});

Requested Fix: Please update the type definition in the SDK from [any] to any[] or Array<any> to allow for the passing of multiple company objects, as intended by the API.