Electron License Starter

Clone-and-run Electron app with Keymint license activation pre-configured. Machine binding, activation UI, and license health checks included.

Quick Start

bash
git clone https://github.com/keymint-dev/keymint-electron-starter.git
cd keymint-electron-starter
npm install
cp .env.example .env
# Fill in KEYMINT_CLIENT_API_KEY and KEYMINT_PRODUCT_ID
npm run dev

Opens an Electron window with an activation dialog. Enter a valid Keymint license key, and the main app unlocks.

What's Included

  • License activation — calls POST /key/activate with node-machine-id host binding
  • Activation UI — clean dialog with key entry and status feedback
  • Persistent storage — license key and activation state saved via electron-store
  • Health checks — periodic re-validation to catch revocations
  • Deactivation — frees the activation seat on app quit
  • Preload + IPC — secure bridge between renderer and main process

Configuration

Create a .env file:

text
KEYMINT_CLIENT_API_KEY=km_client_your_key
KEYMINT_PRODUCT_ID=prod_Nx8K2mLpQ4rVtW9sBc
VariableWhere to Find It
KEYMINT_CLIENT_API_KEYKeymint Dashboard → Developer → API Keys (create a client scope key)
KEYMINT_PRODUCT_IDKeymint Dashboard → Products → your product

Project Structure

text
src/
├── main/
│   ├── index.ts          # Electron main process, gates app on license
│   ├── license.ts        # Keymint SDK wrapper (activate, deactivate, health check)
│   └── ipc.ts            # IPC handlers for renderer ↔ main communication
├── preload/
│   └── index.ts          # contextBridge exposing licenseAPI to renderer
├── renderer/
│   ├── activation.html   # Activation dialog
│   └── app.html          # Main app (shown after successful activation)
└── env.d.ts              # Type declarations for env vars

SDK Methods Used

MethodWherePurpose
client.activateKey()license.tsValidate and bind license to machine
client.deactivateKey()license.tsFree activation seat on quit
machineIdSync()license.tsHardware fingerprint for hostId

Build & Package

bash
npm run build          # Compile TypeScript
npm run package        # Package with electron-builder

The client API key is compiled into the binary. It has client scope — it can activate, deactivate, and manage floating sessions. It cannot read customer data or modify other licenses.

Next Steps