@laboratoria/hubspot
v1.0.3
Published
Unofficial Hubspot Node.js client
Downloads
1
Keywords
Readme
Unofficial Hubspot Node.js client
:warning: This tool is still in draft stage and is likely to change without notice.
Installation
npm i --save @laboratoria/hubspot
Usage
import { createClient as createHubSpotClient } from '@laboratoria/hubspot';
const hubspot = createHubSpotClient('<YOUR-HUBSPOT-PRIVATE-APP-TOKEN>');
const resultsStream = hubspot.deals.search({
limit: 10,
sorts: [{
propertyName: 'hs_lastmodifieddate',
direction: 'DESCENDING',
}],
properties: ['dealname', 'industria'],
filterGroups: [{
filters: [{
value: '1546080',
propertyName: 'pipeline',
operator: 'EQ',
}],
}],
});
resultsStream.on('error', (err) => {
// ...
});
resultsStream.on('data', (results) => {
// ...
});
resultsStream.on('end', () => {
// ...
});
hubspot.deals.getAll()
.on('error', (error) => {
console.error(error);
})
.on('data', (deals) => {
console.log(deals);
})
.on('end', () => {
console.log('ended!');
});