.NET SDK
SDK 2.1.1 offline migration: configure trusted tenant public keys independently of cache files. No pins means no cached authorization. Persisted offline helpers use the configured client and re-verify the original signed token on every read. Offline setup and migration.
Device and usage operations in SDK 2.1.1: all clients can request key-only device removal using tenant slug, key and activation ID. HTTP 204 confirms removal; protected portals still require OTP/account customer flows. Usage reporting returns boolean confirmation, supports nested/empty metadata objects and normalizes quantities below 1 to 1. Java/C++ use tryMeter/try_meter for that boolean contract and retain legacy detailed meter results. Neither operation retries automatically or uses offline cache. See this SDK's README for signatures and failure handling.
Floating sessions in SDK 2.1.1: checkout and heartbeat return a failed session without credentials on network/HTTP/parse failure (RequestFailed). Business denial preserves its error code or uses FloatingDenied. Floating never uses offline cache. The new boolean TryCheckin equivalent confirms HTTP 204; legacy checkin is best effort. Method names follow this language's conventions. See the source README and SDK availability matrix before choosing a registry version.
Official SDKs.NET SDK
SDK 2.1.1 request settings
A slow or unavailable license server must not leave your application waiting indefinitely. All eight SDKs default to a 10-second timeout for each attempt and two additional attempts for safe requests. The usual backoff is 250 milliseconds, then 500 milliseconds. This is not a single 10-second deadline for the complete operation: activation also fetches a nonce.
- License validation, nonce/public-key retrieval and floating heartbeat may retry a network failure or HTTP 5xx response. Set the retry count to zero to disable these retries; the range is 0–5.
- Floating checkout, activation POST, usage reporting, device removal and checkin are sent once. A lost response can follow a successful server change, so retrying these blindly can duplicate work.
- HTTP 3xx/4xx responses and malformed successful responses do not retry. SDK-owned transports do not follow redirects, so configure the final HTTPS API address directly.
For validate/activate, branch on the server's error code when available. Otherwise
HttpError means an HTTP rejection, InvalidResponse means malformed
successful license/nonce evidence and RequestFailed means the network/5xx attempts
were exhausted without a usable signed cache. Rejection or malformed successful evidence never
becomes cached authorization. A network outage can use only a separately trusted, unexpired proof.
| SDK | Configuration |
|---|---|
| .NET | PermitCoreOptions.Timeout = TimeSpan.FromSeconds(10) and MaxRetries = 2 |
Timeout mechanisms follow each runtime: Python uses socket I/O timeouts; Unity delegates to its transport. Caller cancellation is separate from retry policy. Unity's default adapter disables redirects; WebGL needs Unity 2021.3 or later for that protection and fails closed on older versions. Portable .NET tests do not certify an Editor, IL2CPP or browser build. Verify your actual target before shipping.
Install SDK 2.1.1 using the SDK installation references and follow the offline migration guide when upgrading from 1.x.
The official .NET client targets .NET 6, 7, 8, 9, and 10. Zero dependencies.
Installation
dotnet add package PermitCore.Client --version 2.1.1Quick start — validate on every launch
using PermitCore; var client = new PermitCoreClient("https://api.permitcore.dev"); var result = await client.ValidateAsync( "PERMIT-XXXX-XXXX-XXXX-XXXX", expectedProductId: Guid.Parse("7f3e9a2b-1c4d-4e8f-9a6b-3d2c1e0f5a8b")); // Optional — reject a key issued for a different product instead of silently accepting it if (result.ErrorCode == "WrongProduct") { MessageBox.Show($"This key is for a different product: {result.ProductId}"); Application.Exit(); return; } if (!result.IsValid) { MessageBox.Show($"License invalid: {result.Message}"); Application.Exit(); return; } // Unlock features based on flags if (result.HasFeature("export")) EnableExportMenu(); if (result.IsTrial) ShowTrialBanner($"{result.TrialDaysRemaining} days remaining"); // Warn if vendor subscription is expiring if (result.VendorWarning is not null) ShowStatusWarning(result.VendorWarning);
Activation (first install)
// Call once when the user first installs on a new machine var result = await client.ActivateAsync( licenseKey: "PERMIT-XXXX-XXXX-XXXX-XXXX", deviceId: PermitCoreClient.GetHardwareId(), // auto-generated HWID deviceName: Environment.MachineName, expectedProductId: Guid.Parse("7f3e9a2b-1c4d-4e8f-9a6b-3d2c1e0f5a8b") // Optional — reject a key issued for a different product ); if (result.IsValid) SaveActivationSuccess(); else if (result.ErrorCode == "WrongProduct") ShowError($"Wrong product: {result.ProductId}"); else ShowError($"Could not activate: {result.Message}");
Product scoping: by default, any active key belonging to your tenant validates/activates successfully regardless of which product it was issued for. If you sell more than one product, either check result.ProductId yourself, or pass the optional expectedProductId parameter and let the server reject a mismatch (result.ErrorCode == "WrongProduct"). Find a product's ID in the Admin panel under Products.
Offline mode
When the server is unreachable, the SDK automatically returns the last cached response
for offlineGraceDays days. Enable/disable in options:
var client = new PermitCoreClient(new PermitCoreOptions { BaseUrl = "https://api.permitcore.dev", EnableOfflineCache = true, // default }); var result = await client.ValidateAsync(key); if (result.IsOffline) ShowStatusBar("Running in offline mode");
Floating licenses
Check out a seat when the session starts. While running, heartbeat about every four minutes and handle failed heartbeats. Stop using a rejected session. Cancel the heartbeat loop and await checkin during normal shutdown; process-exit callbacks may not finish network calls. See floating-session lifecycle.