TrustComponent 1.0.1

dotnet add package TrustComponent --version 1.0.1
                    
NuGet\Install-Package TrustComponent -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TrustComponent" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TrustComponent" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="TrustComponent" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TrustComponent --version 1.0.1
                    
#r "nuget: TrustComponent, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TrustComponent@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TrustComponent&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=TrustComponent&version=1.0.1
                    
Install as a Cake Tool

TrustComponent SDK for .NET

The official SDK for the TrustComponent API: TrustCaptcha, TrustAnalytics, TrustMonitoring, Trust VAT Checker and the platform API, in one package. Developed and hosted in the EU.

Targets .NET 8 and .NET Standard 2.0, so it runs on .NET 8 or newer and on every .NET Standard 2.0 runtime (.NET Framework 4.6.2+, .NET Core 2.0+); works from C#, F# and VB.

Install

dotnet add package TrustComponent

Check a TrustCaptcha result

The widget writes a verification token into your form. One call turns it into the result:

using TrustComponent;

using var tc = new TrustComponentClient("ak_…");
var result = await tc.Captcha.GetVerificationResultAsync(Request.Form["tc-verification-token"]);
if (result.IsVerificationPassed) { /* … */ }

The class is TrustComponentClient, because TrustComponent is the namespace.

Create the API key (ak_…) in the dashboard under the project's API keys, or under the agency's API keys to reach its client projects. The key decides which projects and modules the client can use.

Every module

The client is module → resource → operation, with the same names in every language:

using TrustComponent.Model;

var projectId = (await tc.Platform.Projects.GetProjectsAsync()).Content[0].Id;
await tc.Analytics.Websites.GetWebsitesAsync(projectId);
await tc.TaxValidation.Validations.CreateValidationAsync(projectId, new TaxValidationValidationCreateParams(countryCode: "DE", rawValue: "DE811569869"));
await tc.Monitoring.Monitors.PingHeartbeatAsync(monitorId);
await tc.Platform.Events.GetEventsOfProjectAsync(projectId);

The full reference of every operation is at https://docs.trustcomponent.com/api/overview/. Guides per module: TrustCaptcha, TrustAnalytics, TrustMonitoring, Trust VAT Checker (taxValidation in the client), platform. Changes of every release: https://docs.trustcomponent.com/api/release-notes/.

Configuration

using var tc = TrustComponentClient.Builder("ak_…")
    .Timeout(TimeSpan.FromSeconds(5)).MaxRetries(1).Integration("my-plugin/1.0")
    .Build();

Options: Host, Timeout, Proxy, MaxRetries, DeprecationWarnings, Integration, Logger, HttpMessageHandler. Every operation also exists synchronously (GetVerificationResult).

The SDK retries only what the API reserves for retries: 429 with Retry-After, 502, 503, 504 and a lost connection (2 retries by default). When the API marks an operation as deprecated, it logs one warning per operation.

Every write (POST, PUT, PATCH, DELETE) carries an Idempotency-Key, a new one per call and the same one on each of its retries. The VAT Checker answers a retried write with the stored first answer (Idempotent-Replayed: true), so a retry after a lost answer never creates or deletes twice; a server event batch is deduplicated by the id of each event, and a repeated heartbeat ping does no harm. Pass your own key to make a call idempotent beyond one process, e.g. with your order number: using (TrustComponentClient.WithIdempotencyKey("order-4711")) { await tc.TaxValidation.Validations.CreateValidationAsync(projectId, parameters); }. Every request names the SDK in User-Agent and TrustComponent-Sdk, together with the integration you set.

Errors

Every error is a TrustComponent.TrustComponentException carrying the HTTP status and the stable code of the API: InvalidRequestException, AuthenticationException, PermissionException, PaymentRequiredException, LockedException, NotFoundException, ConflictException, GoneException, RateLimitException, ServerException, ConnectionException, OperationRetiredException, VerificationTokenInvalidException. ConnectionException means no usable answer arrived (timeout, DNS, connection refused, TLS failure, or an answer that is not one of the API, e.g. the page of a proxy); the original exception is InnerException.

try
{
    var result = await tc.Captcha.GetVerificationResultAsync(token);
    // evaluate the result
}
catch (Exception e) when (e is ConnectionException or ServerException)
{
    // TrustCaptcha unreachable: apply your failover decision
}
catch (TrustComponentException e)
{
    // not verified: reject (e.Status and e.Code tell why)
}

OperationRetired means the operation was switched off after its sunset: update the SDK.

Support

The GitHub repository of this SDK is a read-only mirror of the released source, so pull requests and issues are not processed there. For questions and bug reports, write to mail@trustcomponent.com or contact support through https://www.trustcomponent.com.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 67 12/1/2026
1.0.0 71 12/1/2026
1.0.0-beta.0 50 12/1/2026
0.0.1-beta.7 54 11/30/2026
0.0.1-beta.6 61 11/30/2026
0.0.1-beta.5 59 11/29/2026
0.0.1-beta.4 61 11/28/2026
0.0.1-beta.3 60 11/28/2026
0.0.1-beta.2 55 11/27/2026
0.0.1-beta.1 63 11/26/2026