hubspot-sdk-patterns

Featured

Apply production-ready @hubspot/api-client SDK patterns for TypeScript. Use when implementing HubSpot integrations, building typed wrappers, or establishing team standards for HubSpot CRM operations. Trigger with phrases like "hubspot SDK patterns", "hubspot best practices", "hubspot typed client", "hubspot api-client wrapper", "idiomatic hubspot".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# HubSpot SDK Patterns ## Overview Production-ready patterns for the `@hubspot/api-client` SDK covering typed wrappers, error handling, batch operations, and pagination. ## Prerequisites - `@hubspot/api-client` v13+ installed - TypeScript 5+ with strict mode - Understanding of HubSpot CRM object model ## Instructions ### Step 1: Typed Client Wrapper ```typescript // src/hubspot/client.ts import * as hubspot from '@hubspot/api-client'; import type { SimplePublicObjectInputForCreate, SimplePublicObject, PublicObjectSearchRequest, } from '@hubspot/api-client/lib/codegen/crm/contacts'; interface HubSpotConfig { accessToken: string; retries?: number; } let instance: hubspot.Client | null = null; export function getClient(config?: HubSpotConfig): hubspot.Client { if (!instance) { instance = new hubspot.Client({ accessToken: config?.accessToken || process.env.HUBSPOT_ACCESS_TOKEN!, numberOfApiCallRetries: config?.retries ?? 3, }); } return instance; } ``` ### Step 2: Error Classification ```typescript // src/hubspot/errors.ts export class HubSpotApiError extends Error { constructor( message: string, public readonly statusCode: number, public readonly category: string, public readonly correlationId: string, public readonly retryable: boolean ) { super(message); this.name = 'HubSpotApiError'; } } export function classifyError(error: any): HubSpotApiError { const status = error?.code || error?.statusCo...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category