IntegralLicenses, plans and feature entitlements for developers who sell software. Signed offline license keys, Polar.sh license keys and React feature gates, without a licensing SaaS.
pnpm add @sweberdev/integralIntegral is a library for developers who sell software: desktop apps, self-hosted tools, CLIs or paid libraries. Licenses are signed with Ed25519 or ECDSA P-256 on your side and verified offline in your app with the public key, so nobody can forge or change one, and no licensing server has to be reachable at runtime. Declare plans with features and limits once, then ask has("export") or check("projects", used) anywhere.
Polar.sh is built in: validate, activate and deactivate Polar license keys through Polar's public API, with a cache and grace period so customers are not locked out offline. Licenses can end updates instead of usage, so versions released before the end keep working after a cancellation. Zero dependencies, runs in Node, browsers and edge runtimes, MIT-licensed. Integral Pro adds a license server that turns Polar orders and subscriptions (and, in beta, Stripe, Paddle and Lemon Squeezy) into signed licenses automatically, signing with keys in a KMS or HSM, and a React activation view.
Example
A short exampleCopy it into your project.
lib/license.ts
import { createEntitlements, definePlans, verifyLicense } from "@sweberdev/integral"
export const plans = definePlans({
free: { features: ["editor"], limits: { projects: 1 } },
pro: { extends: "free", features: ["export"], limits: { projects: 50 } },
})
const result = await verifyLicense(license, { publicKey: INTEGRAL_PUBLIC_KEY, product: "my-app" })
const entitlements = createEntitlements({ plans, license: result.valid ? result.license : null })
entitlements.has("export") // true on Pro
entitlements.check("projects", projects.length).allowedFeatures
What you getFree under MIT, with Pro on top.
Free, MIT
- Signed offline licence keys, no server needed to check them
- Plans with features and limits, trials and update periods
- Polar licence keys, revocation lists and device binding
- CLI to issue, verify and revoke licences
- React bindings; zero dependencies
Pro
- Everything in Free
- Licence server that turns orders and subscriptions into signed licences
- Stripe, Paddle and Lemon Squeezy next to Polar
- Device activations, floating seats and usage metering
- Customer portal and admin view with audit trail
- Keys in a KMS or HSM, key rotation and signed webhooks
All features in detail
Free, MIT
- Signed offline license keys (Ed25519 or ECDSA P-256): no server needed to check them, impossible to forge without your private key
- Plans with features and limits, inheritance and per-customer extras signed into the license
- Polar.sh license keys: validate, activate and deactivate without an access token in your app
- Offline grace: cached checks keep paying customers working when the network is down
- Update periods: licenses that end updates instead of usage, so installed versions keep working
- Signed revocation lists: revoke licenses that are only ever checked offline, including lifetime licenses after a refund
- Device binding: lock a license to one machine with an anonymous machineId()
- Trial licenses and licenseStatus(): days left, expiring soon, update period ended
- Device activation: bindLicense() signs a copy bound to one device, also offline with an activation request file
- License format int2 with algorithm and key id in the header; int1 licenses stay readable, npx integral migrate converts them
- Signer interface: sign with a key that lives in a KMS or HSM instead of a key string
- CLI to create keys and issue, verify, inspect and revoke licenses
- React bindings: <Feature>, <Limit>, useFeature and an async license check hook
- Zero dependencies, runs in Node 22+, browsers, Bun, Deno and edge runtimes
Pro
- License server that turns Polar orders and subscriptions into signed licenses: issue, renew, end, revoke
- Verified Polar webhooks, storage for SQLite, Postgres and MySQL, one fetch handler for Next.js, Hono, Bun and Workers
- Exchange of Polar license keys for signed offline licenses, refresh after renewals
- Signed revocation list endpoint, downloaded and cached offline by the activation view
- Device activations with a limit per license (3 per seat by default), deactivation and offline activation requests
- React license activation view with automatic renewal and upgrade prompts, English and German
- License status banner that warns before a trial, license or update period ends
- Activation view that binds each license to the customer's device and frees the place on removal
- Floating licenses: seats shared between running apps, with heartbeat and automatic expiry
- Usage metering per license, metric and period, refused above the limit in the license
- Audit trail of every license change, exported as JSON or CSV
- Admin API and React admin view: search, revoke, issue again, free devices and seats
- Key rotation: licenses of an old key stay valid, resignAll() signs them again with the new key
- Webhooks for every license event, signed with HMAC or as Slack and Teams messages
- Ready-made license emails in English and German for issue, renewal, cancellation, end and revocation
- Import from Keygen, Cryptlex or a spreadsheet: CSV rows become Integral licenses with mapped plans and a dry run
- Usage billing: counted usage is forwarded to Polar Meters as events
- Trial licenses: one free trial per email address, started from your app and ending by itself
- Offline activation page and guided activation view for computers without internet
- Keys in a KMS or HSM: HashiCorp Vault transit signer and a wrapper for AWS KMS, Google Cloud KMS and Azure Key Vault (cloud recipes beta, not verified with real accounts)
- Stripe, Paddle and Lemon Squeezy next to Polar: signed webhooks become licenses, renewals, cancellations and refunds, including Stripe charge refunds and Paddle refund adjustments (beta, not verified with real accounts)
- Customer portal: a CustomerPortal view with plan, status, update period, usage per period, seats in use and devices, backed by a server overview route
- Customer device management: a device list view where customers free a place themselves
- Floating seats keep working for a configurable time when the license server cannot be reached
| Feature | Free | Pro |
|---|---|---|
| Sign and verify licenses offline | Included | Included |
| Plans, features and limits | Included | Included |
| Polar license key validation and activations | Included | Included |
| Offline grace and update periods | Included | Included |
| Revocation lists, device binding and trial licenses | Included | Included |
| Binding a license to a device, also offline | Included | Included |
| CLI and React feature gates | Included | Included |
| Licenses issued automatically from Polar webhooks | Not included | Included |
| Renewal, cancellation and refund handling | Not included | Included |
| SQL storage and ready-made API routes | Not included | Included |
| Revocation list served and applied automatically | Not included | Included |
| Device limit per license with activate and deactivate | Not included | Included |
| React license activation, status banner and upgrade prompt | Not included | Included |
| Floating seats with heartbeat | Not included | Included |
| Usage metering with limits | Not included | Included |
| Audit trail and CSV export | Not included | Included |
| Admin API and admin view | Not included | Included |
| Key rotation without locking customers out | Not included | Included |
| Event webhooks and license emails | Not included | Included |
| Import from Keygen, Cryptlex and CSV | Not included | Included |
| Usage billing through Polar Meters | Not included | Included |
| Trial licenses started from your app | Not included | Included |
| Offline activation page and guided view | Not included | Included |
| Ed25519 or ECDSA P-256 signatures, int2 license format | Included | Included |
| Signing with keys in a KMS or HSM | Signer interface | Included |
| Stripe, Paddle and Lemon Squeezy as payment sources (beta) | Not included | Included |
| Customer portal with plan, usage and seats | Not included | Included |
| Customer device list and offline tolerance for floating seats | Not included | Included |
| Licence | MIT | Per person |
| Support | GitHub issues | Agency and Lifetime |
Pro
Pro packagesAdd-ons on top of the core.
Try the themes, browse the catalog and read a real scanner report. The demo also shows the GTM container check, the monitoring of many client sites and the catalog changes per project.
@weber-development/integral-serverLicense server: Polar webhooks, issuing, renewing and revoking licenses, SQL storage and a fetch handler.
@weber-development/integral-portalReact license activation with Polar key exchange, offline verification, automatic renewal and upgrade prompts.
Pricing
PricingPrices are in CHF.
Freelancer
For one developer selling their own software.
CHF 120
per year
2 months free
- 1 person
- No support entitlement
Agency
RecommendedFor teams of up to ten named people, one price.
CHF 390
per year
2 months free
- Up to 10 people
- Support included
Lifetime
Pay once for up to ten people and keep updates and repository access.
CHF 1’290
one-time
- Up to 10 people
- Support included
11 people or more: get in touch
- After cancelling, every version you already received keeps working. Only updates and repository access end.
- Your own customers never need a licence for Integral Pro, even though the activation view ships inside your app.
- Agency and Lifetime cover up to ten named people for one price: you choose the number of seats at checkout and assign them in Polar.
- Checkout, invoices and VAT are handled by Polar as merchant of record.
FAQ
QuestionsShort answers.
How is this different from Keygen or other licensing services?
Integral is a library, not a hosted API. Licenses are signed by you and checked offline in your app, so there is no monthly fee per license and no outage that locks out your customers. With Integral Pro you run the license server yourself, next to your app.
Can someone crack it?
Anyone who can change your application can remove a license check, with any licensing tool. What they cannot do is create or change a license without your private key. Integral makes honest use easy and dishonest use deliberate.
Which signature algorithms and key stores does Integral support?
Ed25519 and ECDSA P-256. P-256 is what AWS KMS, Google Cloud KMS, Azure Key Vault and HashiCorp Vault sign with, so Integral Pro 2.0 can issue licenses without the private key ever being in your server. The Vault adapter is tested against a mocked API; the cloud KMS recipes and the Stripe, Paddle and Lemon Squeezy sources are beta and not yet verified with real accounts.
Do I need Polar?
No. The free package signs and checks its own licenses with any shop or none. Polar is built in because it handles payments, invoices and VAT as merchant of record and has license keys of its own.
What happens to my customers when they cancel?
You decide. By default Integral Pro limits the license to the paid update period: versions released until then keep working, newer ones ask for a renewal. Set it to expire instead if you prefer.
Do my customers need a licence for Integral Pro?
No. The licence covers the people building your software. Your customers and the apps you ship to them need nothing.
Can I use the open-source part on its own?
Yes. @sweberdev/integral and @sweberdev/integral-react are MIT-licensed and complete without Pro.
Articles