Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 867 Bytes

README.md

File metadata and controls

38 lines (29 loc) · 867 Bytes

intercomly

A Typescript API for Intercom API v2.0 - Unfinished

import IntercomlyClient from 'intercomly';

const client = new IntercomlyClient({
  token: process.env.INTERCOM_TOKEN,
});
for await (const contacts of client.getContactsByEmailPaginated('test@example.com')) {
  // paginated results
}
// or raw result
await client.getContactsByEmail(email)

// or by external_id
await client.getContactByExternalId(externalId);

// or by intercom internal id and provide custom attributes shape expected
await client.getContact<{ customAttribute: string }>(contactId);
await client.upsertContactByExternalId({
  role: 'user',
  external_id: 'unique_id',
});
await client.upsertTag('Tag Name')