What is KeyBox?
KeyBox is a self-hosted license key management platform that helps you generate, validate, and revoke access to your software applications. It provides a complete solution for protecting your software with machine-bound licenses, real-time validation, and automated lifecycle management.KeyBox is open-source and built with modern technologies including Node.js, Next.js, MongoDB, and Redis for optimal performance and scalability.
Why Use KeyBox?
KeyBox solves the complex challenge of software licensing by providing:Secure License Generation
Generate cryptographically secure license keys tied to your projects and clients
Real-time Validation
Validate licenses in milliseconds with Redis caching layer
Machine Binding
Lock licenses to specific machines to prevent unauthorized sharing
Automated Management
Background daemons handle validation, expiration, and revocation automatically
Perfect For
- SaaS Platforms - Control access with time-based subscriptions
- Desktop Applications - Protect software with machine-locked licenses
- API Services - Manage access to your APIs and microservices
- Enterprise Software - Deploy licensed software to corporate clients
- Developer Tools - Monetize CLI tools and development frameworks
Key Features
License Management
KeyBox provides comprehensive license lifecycle management:- Generate unique license keys with configurable durations (1-12 months)
- Activate licenses on first use with machine binding
- Validate licenses with automatic status checks every 15 minutes
- Revoke licenses instantly when needed
- Expire licenses automatically based on configured duration
License States
Every license in KeyBox has one of four states:| State | Description |
|---|---|
PENDING | License created but not yet activated |
ACTIVE | License activated and currently valid |
EXPIRED | License duration has ended |
REVOKED | License manually revoked by admin |
Multi-Language SDK Support
Integrate KeyBox into your application with official SDKs:Background Validation Daemon
All SDKs include a background validation daemon that:- Validates the license on application startup
- Re-validates every 15 minutes automatically
- Gracefully shuts down your app if license becomes invalid
- Handles network errors without disrupting operation
Architecture Overview
KeyBox consists of three main components:Components
Backend API
Node.js/Express server that handles:
- License generation and validation
- Client and project management
- Authentication with JWT and OAuth
- Redis caching for fast validation
apps/server/Frontend Dashboard
Next.js web application for:
- Managing clients and projects
- Creating and monitoring licenses
- Viewing usage analytics
- Accessing API documentation
apps/web/How It Works
Generate License
Create a license key with:
- Duration (1-12 months)
- Services included
- Project association
PENDING stateActivate on First Run
When the app starts, the SDK:
- Activates the license (changes state to
ACTIVE) - Binds it to the machine ID
- Starts the background validation daemon
Data Models
License Schema
Client Schema
Project Schema
API Endpoints
KeyBox provides RESTful API endpoints for all operations:| Endpoint | Method | Description |
|---|---|---|
/validate | POST | Validate a license key |
/validate/activate | POST | Activate a pending license |
/license/create | POST | Create a new license |
/license/toggle/:key | PATCH | Toggle license status (active/revoked) |
/client | GET/POST | Manage clients |
/project | GET/POST | Manage projects |
See the API Reference for detailed endpoint documentation.
Security Features
Machine Binding
Licenses are bound to unique machine IDs to prevent sharing across devices
JWT Authentication
All API requests require valid JWT tokens for authentication
Redis Caching
Validated licenses are cached to prevent database overload and ensure fast response times
Rate Limiting
API endpoints are rate-limited to prevent abuse
Performance
- Validation Speed: < 10ms (with Redis cache)
- Cache Duration: Configurable TTL
- Background Checks: Every 15 minutes
- Database: MongoDB with indexed queries
Tech Stack
Backend:- Node.js 18+
- Express.js
- TypeScript
- MongoDB (Mongoose)
- Redis
- JWT Authentication
- Next.js 14
- React
- TypeScript
- Tailwind CSS
- Node.js (CommonJS)
- Python 3.10+
- .NET 8.0+
What’s Next?
Quick Start Guide
Get KeyBox up and running in 5 minutes
How It Works
Dive deeper into KeyBox architecture
SDK Integration
Learn how to integrate KeyBox into your app
Deploy KeyBox
Self-host KeyBox on your infrastructure