unified-ts-client
v1.1.3
Published
Typescript client to access Unified.to's APIs
Downloads
15
Readme
Unified.to Typescript Client
TypeScript client for the Unified API
Installing
Package manager
Using NPM:
$ npm install unified-ts-client
Using yarn:
$ yarn add unified-ts-client
Once the package is installed, you can import the library using import
or require
approach:
import Unified from 'unified-ts-client';
Example
import Unified, { ICrmContact, IMarketingMember } from 'unified-ts-client';
// copy contacts from a CRM and adds them as a Marketing Tech member
async function covert(unifiedToken: string, srcConnectionId: string, destConnectionId: string) {
const unified = new Unified({ api_token: unifiedToken });
const contacts = await unified.crm(srcConnectionId).contact.getAll();
(contacts || []).forEach(async (contact) =>
await unified.martech(destConnectionId).member.create(convertContact2Member(contact))
);
}
function convertContact2Member(contact: ICrmContact): IMarketingMember {
// TODO
}