Corsair
PluginsHubSpot

HubSpot

Integrate HubSpot CRM contacts, companies, deals, and tickets

Quick Start

Install the plugin:

pnpm install @corsair-dev/hubspot

Add the HubSpot plugin to your Corsair instance:

corsair.ts
import { createCorsair } from "corsair";
import { hubspot } from "@corsair-dev/hubspot";

export const corsair = createCorsair({
    plugins: [
        hubspot(),
    ],
});

Once configured, you can access the HubSpot API through your Corsair instance:

const contacts = await corsair.hubspot.api.contacts.getMany({
    limit: 10,
});

Authentication

Supported Auth Types

The HubSpot plugin supports both API key and OAuth 2.0 authentication methods.

  • api_key - Private App API key authentication
  • oauth_2 - OAuth 2.0 authentication

API Key Authentication (Private App)

Store credentials with the CLI:

pnpm corsair setup --hubspot api_key=your-api-key

See Get Credentials for step-by-step instructions on obtaining an API key.

OAuth 2.0 Authentication

Store your OAuth app credentials, then start the flow:

pnpm corsair setup --hubspot client_id=your-client-id client_secret=your-client-secret
pnpm corsair auth --plugin=hubspot

The CLI will print an authorization URL — open it in a browser. Once you approve, tokens are saved automatically.

See Get Credentials for step-by-step instructions on setting up OAuth 2.0.

Webhook Secret

Store the webhook secret with the CLI:

pnpm corsair setup --hubspot webhook_signature=your-webhook-secret

See Get Credentials for step-by-step instructions on setting up webhooks.

See Authentication for details on managing credentials.

Options

The HubSpot plugin accepts the following configuration options:

OptionTypeDescription
authType'api_key' | 'oauth_2'Authentication method
credentialsobjectCredentials object (apiKey for api_key, clientId/clientSecret for oauth_2)
webhookSecretstringWebhook signing secret (optional)
hooksobjectEndpoint hooks for custom logic
webhookHooksobjectWebhook hooks for event handling
errorHandlersobjectCustom error handlers

For complete documentation on getting credentials, see the Plugin Credentials Guide.