HubSpot
Integrate HubSpot CRM contacts, companies, deals, and tickets
Quick Start
Install the plugin:
pnpm install @corsair-dev/hubspotAdd the HubSpot plugin to your Corsair instance:
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 authenticationoauth_2- OAuth 2.0 authentication
API Key Authentication (Private App)
Store credentials with the CLI:
pnpm corsair setup --hubspot api_key=your-api-keySee 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=hubspotThe 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-secretSee 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:
| Option | Type | Description |
|---|---|---|
authType | 'api_key' | 'oauth_2' | Authentication method |
credentials | object | Credentials object (apiKey for api_key, clientId/clientSecret for oauth_2) |
webhookSecret | string | Webhook signing secret (optional) |
hooks | object | Endpoint hooks for custom logic |
webhookHooks | object | Webhook hooks for event handling |
errorHandlers | object | Custom error handlers |
For complete documentation on getting credentials, see the Plugin Credentials Guide.