fastify-xhubspot
HubSpot CRM integration — contacts, companies, deals, engagement notes, and custom objects.
fastify-xhubspot
HubSpot CRM plugin for managing contacts, companies, deals, and engagement notes. Ideal for third-party portals.
Installation
npm install @xenterprises/fastify-xhubspot
Quick Start
await fastify.register(xHubspot, {
accessToken: process.env.HUBSPOT_ACCESS_TOKEN,
})
API
// Contacts
const contact = await fastify.xhubspot.contacts.create({ email, firstName, lastName })
const contact = await fastify.xhubspot.contacts.findByEmail(email)
await fastify.xhubspot.contacts.update(contactId, { phone })
// Engagements (notes)
await fastify.xhubspot.engagements.createNote({
contactId,
body: 'Called customer, discussed renewal',
})
// Companies
const company = await fastify.xhubspot.companies.create({ name, domain })
// Deals
const deal = await fastify.xhubspot.deals.create({ name, stage, amount, contactId })
AI Context
package: "@xenterprises/fastify-xhubspot"
decorates: fastify.xhubspot
namespaces: [contacts, companies, deals, engagements, customObjects]
env-required: [HUBSPOT_ACCESS_TOKEN]
use-when: Syncing user actions to HubSpot CRM, portal apps that manage CRM records
