npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wellze/integration-hubspot

v0.0.0

Published

HubSpot integration for Wellze workflows.

Readme

@wellze/integration-hubspot

HubSpot integration for Wellze workflows.

Overview

This package provides HubSpot integration bindings, triggers, and steps for building workflows that interact with HubSpot CRM.

Installation

pnpm add @wellze/integration-hubspot

Trigger Presets

Webhook Triggers

HubSpot webhook triggers fire when events occur in your HubSpot account.

Contact Webhooks

import { webhooks } from '@wellze/integration-hubspot';
import { attachTrigger } from '@wellze/workflow-core';
import { myWorkflow } from './workflow';

// Contact created
const contactCreated = webhooks.contactCreated().createTrigger({
  name: 'HubSpot Contact Created',
  description: 'Fires when a new contact is created',
  transform: (events, credentials) => {
    // events: HubSpotWebhookEvent[] - typed automatically
    // credentials: HubSpotCredentials - typed automatically
    return {
      contactId: String(events[0]?.objectId ?? ''),
    };
  },
});

// Contact deleted
const contactDeleted = webhooks.contactDeleted().createTrigger({
  name: 'HubSpot Contact Deleted',
  transform: (events) => ({
    contactId: String(events[0]?.objectId ?? ''),
  }),
});

// Contact property changed
const contactPropertyChanged = webhooks.contactPropertyChanged().createTrigger({
  name: 'HubSpot Contact Property Changed',
  transform: (events) => ({
    contactId: String(events[0]?.objectId ?? ''),
    property: events[0]?.propertyName,
    oldValue: events[0]?.propertyValue,
  }),
});

// Contact email changed
const contactEmailChanged = webhooks.contactEmailChanged().createTrigger({
  name: 'HubSpot Contact Email Changed',
  transform: (events) => ({
    contactId: String(events[0]?.objectId ?? ''),
    newEmail: events[0]?.propertyValue,
  }),
});

// Attach to workflow
export const binding = attachTrigger({
  workflow: myWorkflow,
  trigger: contactCreated,
  transform: (payload, credentials) => {
    return {
      contactId: String(payload[0]?.objectId ?? ''),
    };
  },
});

Company Webhooks

import { webhooks } from '@wellze/integration-hubspot';

// Company created
const companyCreated = webhooks.companyCreated().createTrigger({
  name: 'HubSpot Company Created',
  transform: (events) => ({
    companyId: String(events[0]?.objectId ?? ''),
  }),
});

// Company deleted
const companyDeleted = webhooks.companyDeleted().createTrigger({
  name: 'HubSpot Company Deleted',
  transform: (events) => ({
    companyId: String(events[0]?.objectId ?? ''),
  }),
});

// Company property changed
const companyPropertyChanged = webhooks.companyPropertyChanged().createTrigger({
  name: 'HubSpot Company Property Changed',
  transform: (events) => ({
    companyId: String(events[0]?.objectId ?? ''),
    property: events[0]?.propertyName,
  }),
});

Deal Webhooks

import { webhooks } from '@wellze/integration-hubspot';

// Deal created
const dealCreated = webhooks.dealCreated().createTrigger({
  name: 'HubSpot Deal Created',
  transform: (events) => ({
    dealId: String(events[0]?.objectId ?? ''),
  }),
});

// Deal deleted
const dealDeleted = webhooks.dealDeleted().createTrigger({
  name: 'HubSpot Deal Deleted',
  transform: (events) => ({
    dealId: String(events[0]?.objectId ?? ''),
  }),
});

// Deal property changed
const dealPropertyChanged = webhooks.dealPropertyChanged().createTrigger({
  name: 'HubSpot Deal Property Changed',
  transform: (events) => ({
    dealId: String(events[0]?.objectId ?? ''),
    property: events[0]?.propertyName,
  }),
});

// Deal stage changed
const dealStageChanged = webhooks.dealStageChanged().createTrigger({
  name: 'HubSpot Deal Stage Changed',
  transform: (events) => ({
    dealId: String(events[0]?.objectId ?? ''),
    newStage: events[0]?.propertyValue,
  }),
});

Ticket Webhooks

import { webhooks } from '@wellze/integration-hubspot';

// Ticket created
const ticketCreated = webhooks.ticketCreated().createTrigger({
  name: 'HubSpot Ticket Created',
  transform: (events) => ({
    ticketId: String(events[0]?.objectId ?? ''),
  }),
});

// Ticket deleted
const ticketDeleted = webhooks.ticketDeleted().createTrigger({
  name: 'HubSpot Ticket Deleted',
  transform: (events) => ({
    ticketId: String(events[0]?.objectId ?? ''),
  }),
});

// Ticket property changed
const ticketPropertyChanged = webhooks.ticketPropertyChanged().createTrigger({
  name: 'HubSpot Ticket Property Changed',
  transform: (events) => ({
    ticketId: String(events[0]?.objectId ?? ''),
    property: events[0]?.propertyName,
  }),
});

Polling Triggers

Polling triggers check for new data periodically:

import { polling } from '@wellze/integration-hubspot';

// Recent contacts
const recentContacts = polling.recentContacts().createTrigger({
  name: 'Recent HubSpot Contacts',
  schedule: '*/10 * * * *', // Every 10 minutes
});

// Recent companies
const recentCompanies = polling.recentCompanies().createTrigger({
  name: 'Recent HubSpot Companies',
  schedule: '*/15 * * * *', // Every 15 minutes
});

// Recent deals
const recentDeals = polling.recentDeals().createTrigger({
  name: 'Recent HubSpot Deals',
  schedule: '*/20 * * * *', // Every 20 minutes
});

// Recent tickets
const recentTickets = polling.recentTickets().createTrigger({
  name: 'Recent HubSpot Tickets',
  schedule: '*/5 * * * *', // Every 5 minutes
});

Steps

Contacts

import { getContact, createContact, updateContact } from '@wellze/integration-hubspot';

// Get contact
const contact = await getContact({
  contactId: '123',
  properties: ['email', 'firstname', 'lastname'],
});

// Create contact
const newContact = await createContact({
  properties: {
    email: '[email protected]',
    firstname: 'John',
    lastname: 'Doe',
  },
});

// Update contact
const updated = await updateContact({
  contactId: '123',
  properties: {
    firstname: 'Jane',
  },
});

Companies

import { getCompany, createCompany, updateCompany } from '@wellze/integration-hubspot';

// Get company
const company = await getCompany({
  companyId: '456',
  properties: ['name', 'domain'],
});

// Create company
const newCompany = await createCompany({
  properties: {
    name: 'Acme Corp',
    domain: 'acme.com',
  },
});

// Update company
const updated = await updateCompany({
  companyId: '456',
  properties: {
    name: 'Acme Corporation',
  },
});

Deals

import { getDeal, createDeal, updateDeal } from '@wellze/integration-hubspot';

// Get deal
const deal = await getDeal({
  dealId: '789',
  properties: ['dealname', 'amount', 'dealstage'],
});

// Create deal
const newDeal = await createDeal({
  properties: {
    dealname: 'New Deal',
    amount: '10000',
    dealstage: 'appointmentscheduled',
  },
});

// Update deal
const updated = await updateDeal({
  dealId: '789',
  properties: {
    dealstage: 'qualifiedtobuy',
  },
});

Type Safety

All triggers and steps provide full type inference:

import type { InferTriggerPayload, InferTriggerCredentials } from '@wellze/workflow-core';

const contactCreated = webhooks.contactCreated().createTrigger({
  name: 'Contact Created',
});

type Payload = InferTriggerPayload<typeof contactCreated>; // HubSpotWebhookPayload
type Credentials = InferTriggerCredentials<typeof contactCreated>; // HubSpotCredentials

Credentials

HubSpot credentials require:

  • accessToken: string - HubSpot API access token

Webhook Verification

HubSpot webhooks are automatically verified using the integration's verification logic. The verification supports HubSpot signature verification versions 1, 2, and 3.

Examples

See packages/test-workflows/workflows/ for complete workflow examples using HubSpot triggers and steps.