Skip to main content

Available SDKs

KeyBox provides official SDKs for the most popular programming languages and frameworks. Each SDK offers the same core functionality with language-specific idioms and best practices.

Node.js SDK

For Express, Next.js, and Node.js applications

Python SDK

For FastAPI, Django, and Python applications

.NET SDK

For ASP.NET Core and .NET applications

Core Features

All KeyBox SDKs provide:
One-time activation to verify a license key before your application starts. Prevents unauthorized usage from the start.
Continuous license validation every 15 minutes. Automatically shuts down your application if a license is revoked or expires.
Framework-specific helpers that wrap your entire application with license protection in a single function call.
When a license becomes invalid, the SDK gracefully closes connections and shuts down your application to prevent data corruption.

Choosing the Right SDK

Best for:
  • Express.js applications
  • Next.js API routes
  • Electron desktop apps
  • CLI tools built with Node.js
Package: keybox-sdkCurrent Version: 1.0.1View Node.js SDK Documentation →

Common Use Cases

Protecting a Web API

All SDKs provide a simple way to protect your web API:
import { protectNodeApp } from 'keybox-sdk';

await protectNodeApp({
  app: expressApp,
  port: 3000,
  productName: 'My API',
  key: process.env.LICENSE_KEY
});

Manual License Management

For applications that need more control:
import { activateLicense, startLicenseDaemon } from 'keybox-sdk';

// Activate once
await activateLicense({
  productName: 'My App',
  key: licenseKey
});

// Start background validation
await startLicenseDaemon({
  productName: 'My App',
  key: licenseKey,
  onRevoke: (data) => {
    console.error('License revoked:', data);
    process.exit(1);
  }
});

Configuration

API URL

All SDKs default to the production KeyBox API at https://api-keybox.vercel.app. You can override this for self-hosted instances:
await activateLicense({
  productName: 'My App',
  key: licenseKey,
  apiUrl: 'https://your-domain.com'
});

Validation Interval

All SDKs validate licenses every 15 minutes (900 seconds) by default. This interval is fixed to balance license enforcement with API costs.
The validation daemon runs in the background and does not block your application. Network errors are handled gracefully - your app continues running if the validation server is temporarily unreachable.

Error Handling

Activation Errors

All SDKs throw exceptions when activation fails:
try {
  await activateLicense({ productName, key });
} catch (error) {
  console.error('Activation failed:', error.message);
  process.exit(1);
}

Validation Errors

The background daemon logs errors but keeps your app running during temporary network issues. Only permanent failures (revoked, expired, invalid) trigger shutdown.

Next Steps

Quick Start

Get started with KeyBox in under 5 minutes

API Reference

Explore the complete API documentation

Examples

See real-world integration examples

Troubleshooting

Common issues and solutions

Build docs developers (and LLMs) love