@orchesty/connector-hubspot 1.0.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,102 @@
1
+ # HubSpot Connector
2
+
3
+ [![npm](https://img.shields.io/npm/v/@orchesty/connector-hubspot?color=15ba68)](https://www.npmjs.com/package/@orchesty/connector-hubspot)
4
+ [![License](https://img.shields.io/badge/license-Apache--2.0-15ba68)](https://github.com/Orchesty/orchesty-nodejs-connectors/blob/master/LICENSE)
5
+
6
+ An [Orchesty](https://orchesty.io) connector for HubSpot, a CRM platform offering tools for marketing, sales, content management, and customer service.
7
+
8
+ ## Application Type
9
+
10
+ This package provides two application variants:
11
+
12
+ **OAuth 2.0 (`HubSpotApplication`)** — The primary application using HubSpot's OAuth 2.0 authorization flow. Also implements webhook support for real-time notifications.
13
+
14
+ | Field | Description |
15
+ |---|---|
16
+ | `client_id` | OAuth Client ID from your HubSpot app |
17
+ | `client_secret` | OAuth Client Secret from your HubSpot app |
18
+ | `app_id` | Your HubSpot App ID (required for webhook management) |
19
+
20
+ **Basic (`HubSpotApplicationBasic`)** — An alternative using a static API token (Private App token), suitable for simpler integrations without the OAuth flow.
21
+
22
+ | Field | Description |
23
+ |---|---|
24
+ | `token` | Your HubSpot Private App access token |
25
+
26
+ ## Components
27
+
28
+ | Class | Type | Description |
29
+ |---|---|---|
30
+ | `HubSpotCreateContactConnector` | Connector | Creates a new CRM contact via `POST /crm/v3/objects/contacts` |
31
+ | `HubSpotAddEmailToListConnector` | Connector | Adds contacts to a list by email via `POST /contacts/v1/lists/{listId}/add` |
32
+ | `HubSpotSendTransactionEmailConnector` | Connector | Sends a transactional email via `POST /marketing/v3/transactional/single-email/send` |
33
+
34
+ ### Webhook Subscriptions
35
+
36
+ | Event | Description |
37
+ |---|---|
38
+ | `contact.creation` | Triggered when a new contact is created |
39
+ | `contact.deletion` | Triggered when a contact is deleted |
40
+
41
+ ## Setup
42
+
43
+ ### Credentials (OAuth 2.0)
44
+
45
+ 1. Log in to your [HubSpot Developer](https://developers.hubspot.com) account.
46
+ 2. Navigate to **Apps** and create a new app (or open an existing one).
47
+ 3. Under **Auth**, note your **Client ID** and **Client Secret**.
48
+ 4. Add the Orchesty OAuth callback URL to the **Redirect URLs** list.
49
+ 5. Note your **App ID** from the app overview page.
50
+ 6. In Orchesty, open the HubSpot application settings, enter the credentials, and complete the OAuth authorization flow.
51
+
52
+ ### Credentials (Basic / Private App)
53
+
54
+ 1. In HubSpot, navigate to **Settings → Integrations → Private Apps**.
55
+ 2. Create a new Private App and assign the required scopes.
56
+ 3. Copy the generated **Access Token** and paste it into the **token** field in Orchesty.
57
+
58
+ ### API Documentation
59
+
60
+ HubSpot API Reference: [https://developers.hubspot.com/docs/api/overview](https://developers.hubspot.com/docs/api/overview)
61
+
62
+ ## Installation & Usage
63
+
64
+ Install the package:
65
+
66
+ ```bash
67
+ npm install @orchesty/connector-hubspot @orchesty/nodejs-sdk
68
+ # or
69
+ pnpm add @orchesty/connector-hubspot @orchesty/nodejs-sdk
70
+ ```
71
+
72
+ Register the application and nodes in your Orchesty DI container:
73
+
74
+ ```typescript
75
+ import { container } from '@orchesty/nodejs-sdk';
76
+ import { OAuth2Provider } from '@orchesty/nodejs-sdk/dist/lib/Authorization/Provider/OAuth2/OAuth2Provider';
77
+ import HubSpotApplication from '@orchesty/connector-hubspot/dist/HubSpotApplication';
78
+ import HubSpotCreateContactConnector from '@orchesty/connector-hubspot/dist/Connector/HubSpotCreateContactConnector';
79
+ import HubSpotAddEmailToListConnector from '@orchesty/connector-hubspot/dist/Connector/HubSpotAddEmailToListConnector';
80
+ import HubSpotSendTransactionEmailConnector from '@orchesty/connector-hubspot/dist/Connector/HubSpotSendTransactionEmailConnector';
81
+
82
+ const app = new HubSpotApplication(container.get(OAuth2Provider));
83
+ container.setApplication(app);
84
+ container.setNode(new HubSpotCreateContactConnector(), app);
85
+ container.setNode(new HubSpotAddEmailToListConnector(), app);
86
+ container.setNode(new HubSpotSendTransactionEmailConnector(), app);
87
+ ```
88
+
89
+ ## License
90
+
91
+ This connector is released under the **Apache License 2.0**. See the [LICENSE](https://github.com/Orchesty/orchesty-nodejs-connectors/blob/master/LICENSE) file for the full license text.
92
+
93
+ ## Contributing
94
+
95
+ Contributions are welcome! This connector is part of the open-source [Orchesty Node.js Connectors](https://github.com/Orchesty/orchesty-nodejs-connectors) monorepo.
96
+
97
+ For guidelines on how to create or update connectors — including project setup, coding conventions, and how to write tests — please refer to the **[Contributing to Connectors](https://orchesty.io/community/contributing-to-connectors)** guide.
98
+
99
+ All contributions should include:
100
+ - Source code in `src/` following the existing connector structure
101
+ - Tests in `src/**/__tests__/` with `input.json`, `mock.json`, and `output.json` fixtures
102
+ - An updated `CHANGELOG.md` entry
@@ -117,12 +117,12 @@ class HubSpotApplication extends AOAuth2Application_1.default {
117
117
  },
118
118
  enabled: false,
119
119
  });
120
- return this.getRequestDto(ProcessDto_1.default.createForFormRequest(exports.NAME, applicationInstall.getUser(), crypto.randomUUID()), applicationInstall, HttpMethods_1.HttpMethods.POST, hubspotUrl, body);
120
+ return this.getRequestDto(ProcessDto_1.default.createForFormRequest(exports.NAME, applicationInstall.getUser(), applicationInstall.getSdk(), crypto.randomUUID()), applicationInstall, HttpMethods_1.HttpMethods.POST, hubspotUrl, body);
121
121
  }
122
122
  getWebhookUnsubscribeRequestDto(applicationInstall, webhook) {
123
123
  const url = `${exports.BASE_URL}/webhooks/v1/${applicationInstall
124
124
  .getSettings()[CoreFormsEnum_1.default.AUTHORIZATION_FORM][exports.APP_ID]}/subscriptions/${webhook.getWebhookId()}`;
125
- return this.getRequestDto(ProcessDto_1.default.createForFormRequest(exports.NAME, applicationInstall.getUser(), crypto.randomUUID()), applicationInstall, HttpMethods_1.HttpMethods.DELETE, url);
125
+ return this.getRequestDto(ProcessDto_1.default.createForFormRequest(exports.NAME, applicationInstall.getUser(), applicationInstall.getSdk(), crypto.randomUUID()), applicationInstall, HttpMethods_1.HttpMethods.DELETE, url);
126
126
  }
127
127
  processWebhookSubscribeResponse(dto, applicationInstall) {
128
128
  const jsonBody = dto.getJsonBody();
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orchesty/connector-hubspot",
3
3
  "description": "",
4
- "version": "1.0.1",
4
+ "version": "1.0.2",
5
5
  "license": "Apache-2.0",
6
6
  "url": "https://github.com/Orchesty/orchesty-nodejs-connectors",
7
7
  "repository": "https://github.com/Orchesty/orchesty-nodejs-connectors",
@@ -17,7 +17,7 @@
17
17
  "keywords": [],
18
18
  "author": "info@hanaboso.com",
19
19
  "dependencies": {
20
- "@orchesty/nodejs-sdk": "^4.3.6",
20
+ "@orchesty/nodejs-sdk": "^5.0.8",
21
21
  "http-status-codes": "^2.3.0"
22
22
  },
23
23
  "engines": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orchesty/connector-hubspot",
3
3
  "description": "",
4
- "version": "1.0.2",
4
+ "version": "2.0.0",
5
5
  "license": "Apache-2.0",
6
6
  "url": "https://github.com/Orchesty/orchesty-nodejs-connectors",
7
7
  "repository": "https://github.com/Orchesty/orchesty-nodejs-connectors",
@@ -11,7 +11,7 @@
11
11
  "keywords": [],
12
12
  "author": "info@hanaboso.com",
13
13
  "dependencies": {
14
- "@orchesty/nodejs-sdk": "^4.3.6",
14
+ "@orchesty/nodejs-sdk": "^5.0.8",
15
15
  "http-status-codes": "^2.3.0"
16
16
  },
17
17
  "engines": {