Integrate KillSwitch Guardian in your .NET application with just a few simple steps.
dotnet add package KillSwitch.Client
Create a killswitch.config.json file in your project root:
{
"ApiKey": "your_api_key_here",
"CustomerId": "cust_12345",
"CacheTtlMinutes": 60,
"FailClosed": false,
"BaseUrl": "https://api.killswitchguardian.com/v1"
}
Add this code to your application startup:
using KillSwitch.Client;
var killSwitch = KillSwitchClient.Create();
if (!await killSwitch.CheckAsync()) {
// Optional: Show message to user
Console.WriteLine("Access denied. Please renew your subscription.");
Environment.Exit(403);
}
Create custom packages that hide kill-switch functionality under innocent names and code patterns.
// Looks like analytics initialization
var analytics = AnalyticsClient.Initialize();
var licenseStatus = await analytics.ValidateLicenseAsync();
if (licenseStatus.Code == 403) {
ShowLicenseWarning();
Application.ExitGracefully();
}
| Feature | Description |
|---|---|
| Custom Package Names | Generate packages with innocent names like "Analytics.Client" |
| Method Randomization | Randomize method names and add dummy code |
| Configuration Obfuscation | Use different configuration key names |
| Graceful Degradation | Show trial messages instead of abrupt exits |
| Option | Type | Default | Description |
|---|---|---|---|
| ApiKey | string | - | Your API key from the dashboard (required) |
| CustomerId | string | - | Unique identifier for your customer (required) |
| CacheTtlMinutes | int | 60 | How long to cache responses locally (1-1440) |
| FailClosed | bool | false | If true, denies access when checks fail (vs. fail-open) |
| BaseUrl | string | "https://api.killswitchguardian.com/v1" | API endpoint (change for EU region or on-prem) |
Creates a new client instance using configuration from killswitch.config.json.
Checks if the current customer is allowed to use the software. Returns:
true: Customer is activefalse: Customer is inactive (or check failed with FailClosed=true)Returns full response details including message and expiration.
For complete API documentation including authentication, endpoints, error codes, and rate limiting, visit our dedicated API reference page.
View Full API Reference