NuGet v2.0.0

.NET / C# SDK

Official .NET / C# SDK for Traffic Orchestrator. Validate licenses, manage keys, and integrate license management into your application in minutes.

dotnet add package TrafficOrchestrator

Quick Start

Initialize the client and start validating licenses.

csharp
using TrafficOrchestrator;

var client = new TrafficOrchestratorClient(
    "https://api.trafficorchestrator.com/api/v1"
);

License Validation

Validate a license key against a domain with a single call.

csharp
// Validate a license key
var result = await client.ValidateLicenseAsync(
    "TO-XXXX-XXXX-XXXX",
    "example.com"
);

if (result.Valid) {
    Console.WriteLine("License active!");
}

Offline Verification

Verify licenses offline using Ed25519 cryptographic signatures — no network required.

csharp
// Verify offline with Ed25519 signature
var isValid = client.VerifyOffline(
    "TO-XXXX-XXXX-XXXX",
    signature,
    publicKey
);

Management API

Create licenses, list existing keys, and monitor usage with authenticated API calls.

csharp
// Authenticated client for management
var admin = new TrafficOrchestratorClient(
    "https://api.trafficorchestrator.com/api/v1",
    apiKey: "your-api-key"
);

var licenses = await admin.ListLicensesAsync();
var newLicense = await admin.CreateLicenseAsync("my-app", "pro");
var usage = await admin.GetUsageAsync();
var health = await admin.HealthCheckAsync();

Available Methods

validateLicense()
Validate a license key against a domain
verifyOffline()
Cryptographic offline verification (Ed25519)
listLicenses()
List all licenses (requires API key)
createLicense()
Create a new license key (requires API key)
getUsage()
Retrieve usage statistics (requires API key)
healthCheck()
Check API health and connectivity
gracePeriod
Cache validation results for resilience during API outages (v2.1.0+)
clearCache()
Clear cached validation results immediately