Pull your up-to-date HubSpot CRM data into your data warehouse.
hubspotThis package provides a HubSpot CRM v3 connector. It exposes a simple lifecycle and typed domain methods for common objects.
Choose the directory in your project where you want to install the connector.
bash -i <(curl https://registry.514.ai/install.sh) --type connector hubspot v3 514-labs typescript data-api
From the generated hubspot directory, install dependencies and build:
npm install npm run build
Update your project's package.json to include the new connector folder. LLM is great for this!
npm install
import { createHubSpotConnector } from "@workspace/connector-hubspot";async function main() { const hubspot = createHubSpotConnector(); hubspot.initialize({ auth: { type: "bearer", bearer: { token: process.env.HUBSPOT_TOKEN! } }, }); await hubspot.connect(); // Fetch a page of contacts const { data: contactsPage } = await hubspot.listContacts({ limit: 5, properties: ["firstname", "lastname"], }); for (const contact of contactsPage.results) { console.log(`${contact.id}: ${contact.properties.firstname}`); } // Look up a single contact by id const { data: contactDetail } = await hubspot.getContact({ id: contactsPage.results[0].id, properties: ["email"], }); console.log("Email:", contactDetail.properties.email); // Stream deals lazily for await (const deal of hubspot.streamDeals({ pageSize: 100 })) { console.log("Deal", deal.id); break; // remove break to process all deals }}main().catch((err) => { console.error(err); process.exit(1);});The connector wraps several HubSpot CRM endpoints and exposes typed helpers for common objects:
listContacts, getContact, streamContacts, getContactslistCompanies, getCompany, streamCompanies,
getCompanieslistDeals, getDeal, streamDeals, getDealslistTickets, getTicket, streamTickets, getTicketsnotes, calls, emails, meetings, tasks) –
listEngagements, getEngagement, streamEngagements, getEngagementsEach method maps directly to the corresponding HubSpot CRM API endpoint so you can quickly work with data in your workspace.
See docs/configuration.md for all configuration options.