How to license and sell an Electron app
Keep license validation in Electron's main process, expose only a narrow IPC result to the renderer, and publish the app in a Store that handles payment and key delivery.
npm install @permitcore/permitcore
import { app } from 'electron';
import { PermitCoreClient } from '@permitcore/permitcore';
const client = new PermitCoreClient('https://api.permitcore.dev');
const result = await client.validate(
licenseKey,
app.getVersion(),
productId
);
if (!result.isValid) app.quit();From product record to paid customer
Use PermitCore for the licensing layer and the sale. Your customer checks out in your branded Store and receives a working license automatically.
- 01Create
Create the product and license policy
In Products, create the software your key unlocks. Choose its activation limit, validity, offline grace period, version range, and feature flags.
- Create the Electron product
- Set activations per customer
- Choose offline grace for desktop use
- Copy the product ID
- 02Implement
Install the Electron / Node.js SDK and scope the key
Put license activation in the first-run flow and validation at startup. Pass your product ID so a valid key for another product cannot unlock this one.
npm install @permitcore/permitcore- Validate in the main process
- Return only status through a narrow IPC handler
- Activate once and validate on later starts
- Scope every request to the product ID
- 03Verify
Test the real validation path
Run the packaged application with a real test key, then revoke that key and relaunch. Also disconnect the network to confirm the configured offline grace behaves as intended rather than silently bypassing validation.
- 04Sell
Publish the product in your Store
Connect your Stripe account, add the product to your branded PermitCore Store, and publish. Checkout creates the license and delivers it to the customer without a webhook project or a second commerce platform.
- Publish the app and release notes
- Add it to your branded Store
- Connect your Stripe account
- Test payment-to-license delivery
One checkout completes the sale and delivers the license.
Electron / Node.js production checklist
The sample is intentionally small. Add these safeguards before making licensing part of a paid release.
- Never put privileged credentials or validation decisions in renderer code.
- Keep contextIsolation enabled and expose a minimal preload API.
- Test the packaged build; development and packaged storage paths differ.
- Rate-limit repeated activation attempts in the UI and explain lockout states.