SDK Usage

Integrate KeyBox into your application with our SDK

Quick Start

One call wraps your Express app with license enforcement, starts the background validation daemon, and calls app.listen().

index.js
1import express from "express"
2import { protectNodeApp } from "keybox-sdk"
3 
4const app = express()
5 
6app.get("/", (_req, res) => {
7 res.send("Your app is licensed and running.")
8})
9 
10await protectNodeApp({
11 app,
12 port: 3000,
13 productName: "MyApp",
14 key: process.env.KEYBOX_LICENSE_KEY,
15})
  • Activates the license on first run, writes .instance-id to disk
  • Returns HTTP 402 on all requests while inactive
  • Revalidates every 15 minutes — picks up renewals automatically, no restart needed