Getting Started

Integrate KillSwitch Guardian in your .NET application with just a few simple steps.

1. Install the NuGet Package

dotnet add package KillSwitch.Client

2. Add Configuration File

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"

}

3. Initialize and Check

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);

}

Package Obfuscation

Create custom packages that hide kill-switch functionality under innocent names and code patterns.

Why Use Obfuscation?

  • Hide true intentions from reverse engineering
  • Appear as legitimate business software components
  • Protect against code analysis tools
  • Maintain plausible deniability

Example Obfuscated Integration

// Looks like analytics initialization

var analytics = AnalyticsClient.Initialize();

var licenseStatus = await analytics.ValidateLicenseAsync();

if (licenseStatus.Code == 403) {

ShowLicenseWarning();

Application.ExitGracefully();

}

Package Generator Features

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

Configuration Options

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)

SDK Reference

KillSwitchClient Class

static KillSwitchClient Create()

Creates a new client instance using configuration from killswitch.config.json.

Task<bool> CheckAsync()

Checks if the current customer is allowed to use the software. Returns:

  • true: Customer is active
  • false: Customer is inactive (or check failed with FailClosed=true)

Task<KillSwitchResponse> CheckDetailedAsync()

Returns full response details including message and expiration.

API Reference

For complete API documentation including authentication, endpoints, error codes, and rate limiting, visit our dedicated API reference page.

View Full API Reference