@particle-academy/hubspot-js 0.2.0 → 0.3.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/CHANGELOG.md +35 -0
- package/README.md +53 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,40 @@ The four packages share one version, because they are generated from one
|
|
|
7
7
|
`provider/` definition and a version that meant something different in each
|
|
8
8
|
would be a version nobody could reason about.
|
|
9
9
|
|
|
10
|
+
## [0.3.0] — 2026-08-24
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **The README now says how to SET THIS CONNECTOR UP**, in the package itself.
|
|
15
|
+
|
|
16
|
+
Until now it explained what the four packages are, what they cost and why the
|
|
17
|
+
repo is generated — and said nothing about credentials, scopes, sandboxes or
|
|
18
|
+
operations. Somebody who installed it could not learn from it which credentials
|
|
19
|
+
a connection needs, where a human GETS them, which scopes to request, or what
|
|
20
|
+
the connector can actually do. All of that was already in the definition; the
|
|
21
|
+
one document a consumer reads was the one that omitted everything actionable.
|
|
22
|
+
|
|
23
|
+
The new **Setting it up** section carries:
|
|
24
|
+
|
|
25
|
+
- every credential, with the text saying where the value comes from, whether it
|
|
26
|
+
is **per installation** or **per connected account**, and whether it is secret;
|
|
27
|
+
- the OAuth authorize and token URLs and the exact scopes, verbatim;
|
|
28
|
+
- the access-token lifetime, and where refresh tokens ROTATE, the two things a
|
|
29
|
+
host must not do — retry a failed refresh, or refresh concurrently — because a
|
|
30
|
+
replay revokes the entire grant and nothing in the failure says why;
|
|
31
|
+
- the estate in this provider's own terms, including the cases where a
|
|
32
|
+
successful-looking run reaches nobody, or reaches the real one;
|
|
33
|
+
- every action and trigger with its method, path, inputs, and whether it is safe
|
|
34
|
+
to replay;
|
|
35
|
+
- a trigger's provider-side setup, which nobody can derive from anything else.
|
|
36
|
+
|
|
37
|
+
It is **generated from `provider/manifest.json`**, so it cannot drift from what
|
|
38
|
+
the packages do — which is the point at a few hundred providers, where a
|
|
39
|
+
hand-written setup section is a few hundred documents going quietly stale.
|
|
40
|
+
|
|
41
|
+
No code changed. This release exists because a registry and an installing agent
|
|
42
|
+
read the PUBLISHED artifact, and the artifact carried the old README.
|
|
43
|
+
|
|
10
44
|
## [0.2.0] — 2026-08-24
|
|
11
45
|
|
|
12
46
|
### Changed
|
|
@@ -94,3 +128,4 @@ one.
|
|
|
94
128
|
|
|
95
129
|
[0.1.0]: https://github.com/Fancy-Friends/hubspot/releases/tag/v0.1.0
|
|
96
130
|
[0.2.0]: https://github.com/Fancy-Friends/hubspot/releases/tag/v0.2.0
|
|
131
|
+
[0.3.0]: https://github.com/Fancy-Friends/hubspot/releases/tag/v0.3.0
|
package/README.md
CHANGED
|
@@ -27,6 +27,59 @@ dependencies.
|
|
|
27
27
|
subject to the kit's full approval bar, and one per provider is hundreds of
|
|
28
28
|
dependencies nobody is tracking.
|
|
29
29
|
|
|
30
|
+
## Setting it up
|
|
31
|
+
|
|
32
|
+
Everything below is generated from `provider/manifest.json`, so it cannot disagree with what the packages do.
|
|
33
|
+
|
|
34
|
+
### Credentials
|
|
35
|
+
|
|
36
|
+
A HubSpot connection holds 4 values.
|
|
37
|
+
|
|
38
|
+
**Two kinds of value, and mixing them up matters.** A `provider` credential is ONE value for the whole installation — an OAuth app's client secret serves every connected account. An `account` credential is one per connected account. A host that stores the second where it stores the first lets one account's credentials reach another's.
|
|
39
|
+
|
|
40
|
+
| Field | Scope | Secret | Where it comes from |
|
|
41
|
+
|---|---|---|---|
|
|
42
|
+
| **App client ID** | per installation | not secret | From your HubSpot app's Auth tab. ONE value for the whole installation -- the same app serves every connected account. |
|
|
43
|
+
| **App client secret** | per installation | **secret** | From the same Auth tab. Used to exchange the code and to refresh; never sent with an API request. |
|
|
44
|
+
| **Access token** | per connected account | **secret** | Obtained by the host's OAuth exchange, PER CONNECTED ACCOUNT. Expires after 30 minutes -- a host that does not refresh will work all afternoon and be broken by morning. |
|
|
45
|
+
| **Refresh token** *(optional)* | per connected account | **secret** | Also per account. Does not expire, so it is the credential worth protecting most: it mints access tokens indefinitely until the install is revoked. |
|
|
46
|
+
|
|
47
|
+
### Authorising
|
|
48
|
+
|
|
49
|
+
HubSpot uses OAuth2 (authorization_code). The package DECLARES the exchange; the HOST performs it — a consent screen needs a browser, a redirect URI and somewhere to persist the result, and all three belong to the host.
|
|
50
|
+
|
|
51
|
+
- **Authorize URL** — https://app.hubspot.com/oauth/authorize
|
|
52
|
+
- **Token URL** — https://api.hubapi.com/oauth/v1/token
|
|
53
|
+
- **Scopes** — `crm.objects.contacts.write`
|
|
54
|
+
- **Access token lifetime** — 1800 seconds (30 minutes). A host that never refreshes works all afternoon and is broken by morning.
|
|
55
|
+
|
|
56
|
+
The refresh tokens do **not** rotate: the same one is reusable, so a refresh may safely be retried and may run concurrently. Stated rather than assumed, because the opposite — a provider that spends the token and revokes the grant on a replay — looks identical until it happens.
|
|
57
|
+
|
|
58
|
+
### The estate
|
|
59
|
+
|
|
60
|
+
HubSpot has a test estate on the same host, reached with credentials from a SEPARATE test account you register. Selecting sandbox mode uses those credentials.
|
|
61
|
+
|
|
62
|
+
> HubSpot's test estate is a DEVELOPER TEST ACCOUNT: a separate portal you create from the developer account, with its own portal id, its own data and its own OAuth install. Same API host, different account -- so the credential is different and the URL is not. Test accounts expire if unused and carry reduced limits, which is why they are a place to test rather than a place to build against.
|
|
63
|
+
|
|
64
|
+
## What it can do
|
|
65
|
+
|
|
66
|
+
### Actions
|
|
67
|
+
|
|
68
|
+
#### `contact_create` — Create contact
|
|
69
|
+
|
|
70
|
+
Create a contact in HubSpot.
|
|
71
|
+
|
|
72
|
+
`POST /crm/v3/objects/contacts` · **unsafe to replay** — a retried durable run does it TWICE
|
|
73
|
+
|
|
74
|
+
| Input | Required | What it is |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| `email` | yes | HubSpot de-duplicates contacts on email within an account. A contact created without one cannot be de-duplicated, and a retry will make a second. |
|
|
77
|
+
| `firstName` | no | First name |
|
|
78
|
+
| `lastName` | no | Last name |
|
|
79
|
+
| `company` | no | Company |
|
|
80
|
+
| `phone` | no | Phone |
|
|
81
|
+
| `lifecycleStage` | no | HubSpot's own stage names. A value it does not recognise is refused at write time, not at setup. |
|
|
82
|
+
|
|
30
83
|
## Run it before you have credentials
|
|
31
84
|
|
|
32
85
|
Every operation ships a **faker**, whether or not HubSpot has a sandbox. Set a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-academy/hubspot-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "HubSpot for Node — the service descriptor, its faker, its webhook verification, and one function per operation. Plain HTTP on @particle-academy/fancy-connector-core; no vendor SDK.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@particle-academy/fancy-flow": ">=0.47.1 <2.0",
|
|
55
|
-
"@particle-academy/hubspot-ui": "0.
|
|
55
|
+
"@particle-academy/hubspot-ui": "0.3.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependenciesMeta": {
|
|
58
58
|
"@particle-academy/fancy-flow": {
|