Soenneker.Cloudflare.Utils.Client
4.0.1010
Prefix Reserved
dotnet add package Soenneker.Cloudflare.Utils.Client --version 4.0.1010
NuGet\Install-Package Soenneker.Cloudflare.Utils.Client -Version 4.0.1010
<PackageReference Include="Soenneker.Cloudflare.Utils.Client" Version="4.0.1010" />
<PackageVersion Include="Soenneker.Cloudflare.Utils.Client" Version="4.0.1010" />
<PackageReference Include="Soenneker.Cloudflare.Utils.Client" />
paket add Soenneker.Cloudflare.Utils.Client --version 4.0.1010
#r "nuget: Soenneker.Cloudflare.Utils.Client, 4.0.1010"
#:package Soenneker.Cloudflare.Utils.Client@4.0.1010
#addin nuget:?package=Soenneker.Cloudflare.Utils.Client&version=4.0.1010
#tool nuget:?package=Soenneker.Cloudflare.Utils.Client&version=4.0.1010
Soenneker.Cloudflare.Utils.Client
Provides thread-safe, token-keyed caching for configured CloudflareOpenApiClient instances.
Installation
dotnet add package Soenneker.Cloudflare.Utils.Client
Configuration
{
"Cloudflare": {
"ApiKey": "your-api-token",
"RequestResponseLogging": false
}
}
The parameterless Get overload uses Cloudflare:ApiKey. Store API tokens in a secret provider. Request/response logging is optional; authorization headers are redacted by the underlying Cloudflare HTTP provider.
Registration
using Soenneker.Cloudflare.Utils.Client.Registrars;
services.AddCloudflareClientUtilAsSingleton();
Scoped registration is available when the generated-client cache should be scoped. In either case, the utility borrows a singleton Cloudflare HTTP provider so disposing a scoped utility does not tear down the shared HTTP clients.
Usage
using Soenneker.Cloudflare.Utils.Client.Abstract;
CloudflareOpenApiClient client = await clientUtil.Get(cancellationToken);
var response = await client.Zones.GetAsync(
cancellationToken: cancellationToken);
Get(apiKey) maintains a distinct generated client and underlying authenticated HttpClient for each token. Use only a bounded set of long-lived tokens with a singleton utility; arbitrary one-off tokens otherwise remain cached.
Remove(apiKey) and RemoveSync(apiKey) remove the generated client and immediately remove and dispose its underlying HttpClient. Disposing the utility clears its generated-client cache; the separately owned singleton HTTP provider remains alive until its own container lifetime ends.
The returned generated client is shared for its cache lifetime. Do not mutate its request adapter or dispose infrastructure borrowed from it. Cloudflare API errors are surfaced through Kiota's generated exception behavior.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Soenneker.Cloudflare.HttpClient (>= 4.0.407)
- Soenneker.Cloudflare.OpenApiClient (>= 4.0.570)
- Soenneker.Kiota.BearerAuthenticationProvider (>= 4.0.48)
NuGet packages (15)
Showing the top 5 NuGet packages that depend on Soenneker.Cloudflare.Utils.Client:
| Package | Downloads |
|---|---|
|
Soenneker.Cloudflare.Zones
Creates, finds, inspects, and deletes Cloudflare zones. |
|
|
Soenneker.Cloudflare.DnsRecords
A utility for managing Cloudflare DNS records |
|
|
Soenneker.Cloudflare.Workers
Manages Cloudflare Worker scripts and Worker custom domains. |
|
|
Soenneker.Cloudflare.EmailRouting
A utility for managing Cloudflare email routing and addresses |
|
|
Soenneker.Cloudflare.Speed
Manages selected Cloudflare performance settings. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.1010 | 0 | 9/4/2026 |
| 4.0.1002 | 816 | 8/30/2026 |
| 4.0.1001 | 293 | 8/30/2026 |
| 4.0.1000 | 307 | 8/30/2026 |
| 4.0.999 | 276 | 8/30/2026 |
| 4.0.998 | 394 | 8/30/2026 |
| 4.0.997 | 81 | 8/29/2026 |
| 4.0.996 | 93 | 8/29/2026 |
| 4.0.995 | 925 | 8/26/2026 |
| 4.0.994 | 472 | 8/26/2026 |
| 4.0.993 | 152 | 8/26/2026 |
| 4.0.992 | 283 | 8/25/2026 |
| 4.0.991 | 477 | 8/22/2026 |
| 4.0.990 | 253 | 8/22/2026 |
| 4.0.989 | 1,147 | 8/18/2026 |
| 4.0.988 | 548 | 8/18/2026 |
| 4.0.987 | 455 | 8/14/2026 |
| 4.0.986 | 309 | 8/13/2026 |
| 4.0.985 | 394 | 8/13/2026 |
| 4.0.984 | 93 | 8/13/2026 |
Restrict Cloudflare bearer authentication host