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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@forloopy/hubspot

v1.0.4

Published

A Node.js library for interacting with the HubSpot API, with additional auto-tagging functionality.

Downloads

372

Readme

@forloopy/hubspot

@forloopy/hubspot is an open-source and free-to-use NodeJS library for interacting with the HubSpot API. Built as a lightweight and developer-friendly solution, it fully supports ES Modules (ESM) and offers advanced functionality, including an exclusive auto-tagging feature not available in the official SDK. This feature enables the automatic creation and assignment of tags to contacts, streamlining workflows for developers.


Features

  • Lightweight and intuitive integration with the HubSpot API.
  • Exclusive auto-tagging functionality:
    • Automatically create tags.
    • Assign tags to contacts seamlessly.
  • Fully supports ES Modules (ESM).
  • Written in loose TypeScript for flexibility.
  • Open source and completely free.

Installation

Install the package using npm:

npm install @forloopy/hubspot

Usage

Import & Initialise

// Import
import HubSpot from '@forloopy/hubspot';

// Initialise
const hubspot = new HubSpot({
	accessToken: '<HUBSPOT_ACCESS_TOKEN>'
});

Create Contact

const createdContact = await hubspot.contacts.create({
	properties: {
		firstname: '<FIRSTNAME>',
		lastname: '<LASTNAME>',
		email: '<EMAIL>'
	}
});
// Debug
console.log(createdContact)

Get Contact

const contact = await hubspot.contacts.get('<CONTACT_ID>',{});
// Debug
console.log(contact)

List Contacts

const contacts = await hubspot.contacts.getList({});
// Debug
console.log(contacts)

Add Auto-Tag(s) to Contact

// Get contact (really, just setting the :id, as :objData is false)
const contact = await hubspot.contacts.get(contactId, { objData: false });
// Submit value(s) to existing named tags (the values will be created automatically)
const addAutoTags = await contact.addAutoTags({
	my_custom_tags_1: ['<VALUE_1>','<VALUE_2>','<VALUE_3>'],
	my_custom_tags_2: ['<VALUE_1>','<VALUE_2>','<VALUE_3>'],
});
// Debug
console.log(addAutoTags);

Remove Auto-Tag(s) from Contact

// Get contact (really, just setting the :id, as :objData is false)
const contact = await hubspot.contacts.get(contactId, { objData: false });
// Submit value(s) to existing named tags (the values will be created automatically)
const removeAutoTags = await contact.removeAutoTags({
	my_custom_tags_1: ['<VALUE_1>'],
	my_custom_tags_2: ['<VALUE_2>','<VALUE_3>'],
});
// Debug
console.log(removeAutoTags);

Configuration

Coming soon...

Documentation

Coming soon...

Contributing

At this time, this project isn't accepting contributions.