@laboratoria/hubspot

1.0.3 • Public • Published

Unofficial Hubspot Node.js client

Node.js CI

⚠️ 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!');
  });

Readme

Keywords

Package Sidebar

Install

npm i @laboratoria/hubspot

Weekly Downloads

8

Version

1.0.3

License

MIT

Unpacked Size

7.02 kB

Total Files

3

Last publish

Collaborators

  • fares.laboratoria
  • mfdebian
  • bouli
  • lupomontero