The `node-hubspot-api` package provides a Node.js wrapper for interacting with the HubSpot API. Currently at version 1.3.1, this library simplifies common API operations such as retrieving, creating, and updating contacts, and fetching deals. It employs a promises-based architecture for asynchronous operations, returning data in `.then()` and catching errors in `.catch()`. The release cadence is moderate, with several minor releases since v1.0.0, indicating ongoing maintenance and incremental feature additions, such as new methods for getting contacts by email or ID, and bug fixes. Its primary differentiator is its straightforward, idiomatic JavaScript interface to the HubSpot CRM platform, abstracting the underlying HTTP complexities. This wrapper directly exposes common HubSpot API endpoints through a convenient object structure, focusing on essential CRM entities.
npm install node-hubspot-apiVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the HubSpot API client with an API key and perform basic operations like fetching a list of contacts and a single contact by email.
Store your HubSpot API key in an environment variable (e.g., `HUBSPOT_API_KEY`) and access it via `process.env.HUBSPOT_API_KEY`.
Iteratively call the `getAll` method, updating the `vidOffset` with the value from the previous response until no more contacts are returned.
Include `property: ['email', 'firstname', 'lastname', ...]` in your method call options to specify desired contact properties.
Ensure you are on `v1.3.0` or higher to benefit from correct parameter handling. Review your API calls for methods that involve property or parameter overriding to ensure they function as expected after upgrading.
Ensure you `new NodeHubSpotApi(YOUR_API_KEY)` and the `api` object is available before attempting to call `api.contacts.anything()`.
Verify your `HUBSPOT_API_KEY` is correct and active. Ensure it has the necessary permissions for the API endpoints you are trying to access.
Double-check the contact ID or email address for accuracy. Confirm the HubSpot API documentation for the correct endpoint and parameters.
No dependency data recorded yet.