Soenneker.HubSpot.Client
11.0.210
Prefix Reserved
dotnet add package Soenneker.HubSpot.Client --version 11.0.210
NuGet\Install-Package Soenneker.HubSpot.Client -Version 11.0.210
<PackageReference Include="Soenneker.HubSpot.Client" Version="11.0.210" />
<PackageVersion Include="Soenneker.HubSpot.Client" Version="11.0.210" />
<PackageReference Include="Soenneker.HubSpot.Client" />
paket add Soenneker.HubSpot.Client --version 11.0.210
#r "nuget: Soenneker.HubSpot.Client, 11.0.210"
#:package Soenneker.HubSpot.Client@11.0.210
#addin nuget:?package=Soenneker.HubSpot.Client&version=11.0.210
#tool nuget:?package=Soenneker.HubSpot.Client&version=11.0.210
Soenneker.HubSpot.Client
Reuse HubSpot HTTP clients authenticated with one or more private app access tokens.
Install
dotnet add package Soenneker.HubSpot.Client
Configure a default account
{
"HubSpot": {
"Token": "<private app access token>"
}
}
The parameterless Get() requires HubSpot:Token. You can omit it when every call supplies a token explicitly.
Register
using Soenneker.HubSpot.Client.Registrars;
services.AddHubSpotClientUtilAsSingleton();
Use AddHubSpotClientUtilAsScoped() when each scope should own its client set. Provider instances use isolated cache keys, so disposing one scope removes only the HTTP clients created by that provider.
Usage
using Soenneker.HubSpot.Client.Abstract;
HttpClient client = await hubSpotClient.Get(cancellationToken);
HttpResponseMessage response = await client.GetAsync(
"crm/v3/objects/contacts",
cancellationToken);
response.EnsureSuccessStatusCode();
The returned client targets https://api.hubapi.com/ and sends Authorization: Bearer <token>.
To work with multiple HubSpot accounts, pass each private app access token explicitly:
HttpClient tenantClient = await hubSpotClient.Get(
tenantAccessToken,
cancellationToken);
Repeated calls with the same token on the same provider reuse a client. Distinct tokens receive separate clients, preventing credentials from leaking between accounts.
The provider owns returned clients. Let the service container dispose the provider rather than disposing individual cached clients.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Extensions.Configuration (>= 11.0.913)
- Soenneker.Hashing.XxHash (>= 4.0.122)
- Soenneker.Utils.HttpClientCache (>= 4.0.2128)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.HubSpot.Client:
| Package | Downloads |
|---|---|
|
Soenneker.HubSpot.OpenApiClientUtil
Provides cached HubSpot generated clients for one or more private app access tokens |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.210 | 0 | 10/26/2026 |
| 4.0.209 | 0 | 10/26/2026 |
| 4.0.208 | 240 | 10/15/2026 |
| 4.0.207 | 85 | 10/15/2026 |
| 4.0.206 | 96 | 10/14/2026 |
| 4.0.204 | 106 | 10/14/2026 |
| 4.0.203 | 80 | 10/14/2026 |
| 4.0.202 | 99 | 10/14/2026 |
| 4.0.201 | 100 | 10/14/2026 |
| 4.0.194 | 110 | 10/13/2026 |
| 4.0.193 | 90 | 10/13/2026 |
| 4.0.191 | 106 | 10/12/2026 |
| 4.0.190 | 100 | 10/12/2026 |
| 4.0.189 | 86 | 10/12/2026 |
| 4.0.188 | 99 | 10/11/2026 |
| 4.0.187 | 98 | 10/11/2026 |
| 4.0.186 | 103 | 10/11/2026 |
| 4.0.185 | 164 | 10/9/2026 |
| 4.0.184 | 237 | 10/1/2026 |
| 4.0.183 | 134 | 9/29/2026 |
Merge remote-tracking branch 'origin/main'
# Conflicts:
# src/Soenneker.HubSpot.Client/Soenneker.HubSpot.Client.csproj