Agent skill · marketing growth · aiskillstore
hubspot-integration
Expert patterns for HubSpot CRM integration including OAuth
Why this skill is useful
Provides specific patterns and executable code for integrating with HubSpot CRM that the AI wouldn't reliably generate on its own.
What it needs
Requires @hubspot/api-client installed locally. Requires hubspot account access. About 9k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
HubSpot Integration Expert patterns for HubSpot CRM integration including OAuth authentication, CRM objects, associations, batch operations, webhooks, and custom objects. Covers Node.js and Python SDKs. Patterns OAuth 2.0 Authentication Secure authentication for public apps When to use: Building public app or multi-account integration Template // OAuth 2.0 flow for HubSpot import { Client } from "@hubspot/api-client"; // Environment variables const CLIENTID = process.env.HUBSPOTCLIENTID; const CLIENTSECRET = process.env.HUBSPOTCLIENTSECRET; const REDIRECTURI = process.env.HUBSPOTREDIRECTURI; const SCOPES = "crm.objects.contacts.read crm.objects.contacts.write"; // Step 1: Generate authorization URL function getAuthUrl(): string { const authUrl = new URL("https://app.hubspot.com/oauth/authorize"); authUrl.searchParams.set("clientid", CLIENTID); authUrl.searchParams.set("redirecturi", REDIRECTURI); authUrl.searchParams.set("scope", SCOPES); return authUrl.toString(); } // Step 2: Handle OAuth callback async function handleOAuthCallback(code: string) { const response = await fetch("https://api.hubapi.com/oauth/v1/token", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: new URLSearchParams({ granttype: "authorizationcode", clientid: CLIENTID, clientsecret: CLIENTSECRET, redirecturi: REDIRECTURI, code: code, }), }); const tokens = await response.json(); // { // accesstoken: "xxx", // refreshtoken: "xxx", // expiresin: 1800 // 30 minutes // } // Store tokens securely await storeTokens(tokens); return tokens; } // Step 3: Refresh access token (before expiry) async function refreshAccessToken(refreshToken: string) { const response = await fetch("https://api.hubapi.com/oauth/v1/token", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: new URLSearchParams({ granttype: "refreshtoken", clientid: CLIENTID, clientsecret: CLIENTSECRET, refreshtoken: refreshToken, }), }); return response.json(); } // S …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/hubspot-integration