1.3.0 • Published 4 years ago

intercomly v1.3.0

Weekly downloads
76
License
MIT
Repository
github
Last release
4 years ago

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')