@useairfoil/producer-hubspot

中文文档
0.0.3发布于 2026/11/03TypeScriptES Module构建来源已验证

Syncs HubSpot CRM records, custom objects, owners, teams, pipelines, lists, and property definitions from one HubSpot account. It backfills each resource, then polls CRM records and custom objects every 5 minutes and the rest every hour. With an app clien

原始使用文档
文档目录7 节
  1. Config
  2. Setup
  3. API version
  4. Data
  5. Limits
  6. Demo data
  7. Local development

HubSpot producer

Syncs HubSpot CRM records, custom objects, owners, teams, pipelines, lists, and property definitions from one HubSpot account. It backfills each resource, then polls CRM records and custom objects every 5 minutes and the rest every hour. With an app client secret, it also takes webhooks at POST /webhooks/hubspot.

ResourceWhat
contacts, companies, deals, ticketsCore CRM records
calls, emails, meetings, notes, tasks, communications, postal_mailActivities
feedback_submissionsAnswers to feedback surveys
line_items, products, quotes, discounts, fees, taxesProducts and quotes
leadsLeads
invoices, orders, carts, commerce_payments, subscriptionsCommerce
goal_targets, deal_splitGoals and deal splits
usersHubSpot users with their user properties
custom_objectsRecords of every custom object type
owners, teamsRecord owners and their teams
pipelinesPipelines and their stages
listsLists (segments), without members
propertiesProperty definitions, to name properties keys and values

Config

VariableRequiredDefault
HUBSPOT_ACCESS_TOKENyesnone
HUBSPOT_CLIENT_SECRETnonone

Without HUBSPOT_CLIENT_SECRET, webhooks are off and every change comes from polling.

Setup

For polling only, create a service key under Development → Keys → Service keys with these read scopes:

  • crm.objects.contacts.read, crm.schemas.contacts.read
  • crm.objects.companies.read, crm.schemas.companies.read
  • crm.objects.deals.read, crm.schemas.deals.read
  • crm.objects.tickets.read, crm.schemas.tickets.read
  • crm.objects.line_items.read, crm.schemas.line_items.read
  • crm.objects.products.read
  • crm.objects.owners.read
  • sales-email-read
  • crm.objects.quotes.read, crm.objects.leads.read
  • crm.objects.feedback_submissions.read, crm.objects.goals.read, crm.objects.users.read
  • crm.objects.invoices.read, crm.objects.orders.read, crm.objects.carts.read, crm.objects.commercepayments.read, crm.objects.subscriptions.read
  • crm.objects.custom.read, crm.schemas.custom.read
  • crm.lists.read, settings.users.teams.read

Communications, postal mail, discounts, fees, taxes, and deal splits need no extra scope.

Use the key as HUBSPOT_ACCESS_TOKEN.

Service keys can't receive webhooks. For webhooks, upload the app in hubspot-app/ with the HubSpot CLI instead:

  1. Set targetUrl in hubspot-app/src/app/webhooks/webhooks-hsmeta.json to <connector>/webhooks/hubspot.
  2. Run hs account auth, then hs project upload from hubspot-app/.
  3. Install the app from Development → Projects → airfoil-connector → Distribution.
  4. Use the access token from the Distribution tab as HUBSPOT_ACCESS_TOKEN and the client secret from the Auth tab as HUBSPOT_CLIENT_SECRET.

The app asks for every scope above, and apps with static auth can't make a scope optional. On an account without a feature, such as custom objects, leads, or Commerce Hub, remove its scopes from hubspot-app/src/app/app-hsmeta.json and its subscriptions from webhooks-hsmeta.json before uploading.

For custom object webhooks, add object.creation, object.deletion, and object.restore subscriptions with the object's name, such as vehicle, as objectType. The app can't list each account's custom objects for you.

One token reads one account, so run one connector per account.

API version

The connector uses the 2026-09 API paths, such as /crm/objects/2026-09/contacts.

Data

  • CRM tables keep every non-empty property in properties, by internal name, as strings. New custom properties show up on their own. Sensitive properties are left out.
  • Contacts, deals, tickets, activities, quotes, leads, commerce records, line items, deal splits, and custom objects have lists of associated record IDs.
  • custom_objects holds every custom object type. object_type_id (such as 2-123) and object_type (its name) say which, and key is <object_type_id>:<id>. Rows of a deleted type stay.
  • properties names the keys in properties and the values of dropdowns. Pipeline stages are in pipelines.
  • users has user properties. owners maps users to the owner IDs on records.
  • A deleted record gets _deleted. So do records merged into another one.
  • Owners, pipelines, and property definitions stay with archived = true when removed. Removed teams and lists stay as they were.
  • CRM record tables, custom objects included, hold customer data such as names, emails, phone numbers, message bodies, and form answers. Treat them as customer data.

Limits

  • Calculated properties and association lists can be a day old, or a week for activities, line items, and products. Webhooks bring association changes right away.
  • Without webhooks, these deletes are missed: GDPR deletes, and deleted emails, meetings, communications, invoices, payments, subscriptions, users, and deal splits. HubSpot can't list them.
  • An account without a feature, such as leads or custom objects, or a token without its scope, leaves that table in error. The other tables keep syncing.
  • Deal splits have no webhooks, so they only come from polling. Custom object association lists also only update by polling, at most a day late.
  • A new custom object type shows up within an hour.
  • A record restored from the recycle bin comes back on its next read: a webhook, a search hit, or the full re-read.
  • Searches, polls of deleted records, and full re-reads share the account's daily API limit with its other apps.

Demo data

pnpm demo --size 128MiB writes made-up HubSpot data without HubSpot credentials. See the Connector Kit README for the flags and the variables it needs.

Each company has contacts, deals with line items, quotes, and splits, tickets, sales activity, leads, and, once a deal is won, a subscription, an order, invoices, payments, and an onboarding project in custom_objects. Properties use HubSpot's internal names. The account setup is written once and doesn't grow with the size: owners, users, teams, pipelines, properties, lists, products, discounts, fees, taxes, and goals.

Local development

cd connectors/producer-hubspot
pnpm sandbox

To record VCR, put a test account's service key in .env, delete test/__cassettes__/api.vcr.test.cassette, and run pnpm test:ci. Recording takes a few minutes. Check the new cassette for personal data before committing it.

pnpm start runs the hosted connector. It needs the Wings and PostgreSQL variables from the Connector Kit README.

版本与发布记录

@useairfoil/producer-hubspot 共发布 4 个版本,首次发布于 2026/10/29;过去 12 个月发布了 4 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.0.3latest2026/11/03今天
0.0.22026/10/295 天前
0.0.12026/10/295 天前
0.0.0-stage2026/10/295 天前

关于 @useairfoil/producer-hubspot 的常见问题

@useairfoil/producer-hubspot 是什么?

同步HubSpot CRM记录,自定义对象,所有者,团队,管道,列表和属性定义从一个HubSpot帐户。它回填每个资源,然后每5分钟轮询CRM记录和自定义对象,其余的每小时轮询一次。使用应用程序客户端

如何安装 @useairfoil/producer-hubspot?

在项目目录运行 npm install @useairfoil/producer-hubspot,或使用 pnpm add / yarn add / bun add。

@useairfoil/producer-hubspot 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@useairfoil/producer-hubspot 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@useairfoil/producer-hubspot 可以商用吗?

@useairfoil/producer-hubspot 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@useairfoil/producer-hubspot 还在维护吗?

最新版本 0.0.3 发布于 2026/11/03(今天);至今共发布 4 个版本,其中过去 12 个月发布了 4 个;首次发布于 2026/10/29。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。