Skip to main content
Introducing packages.sweber.dev
All packages
BetaMIT + Pro

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/integral

Integral is a library for developers who sell software: desktop apps, self-hosted tools, CLIs or paid libraries. Licenses are signed with Ed25519 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 into signed licenses automatically, 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).allowed

Features

What you getFree under MIT, with Pro on top.

Free, MIT

  • Signed offline license keys (Ed25519): 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
  • CLI to create keys and issue, verify and inspect licenses
  • React bindings: <Feature>, <Limit>, useFeature and an async license check hook
  • Zero dependencies, runs in Node 20+, 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
  • React license activation view with automatic renewal and upgrade prompts, English and German

Compare

Free and ProSide by side.

FeatureFreePro
Sign and verify licenses offlineIncludedIncluded
Plans, features and limitsIncludedIncluded
Polar license key validation and activationsIncludedIncluded
Offline grace and update periodsIncludedIncluded
CLI and React feature gatesIncludedIncluded
Licenses issued automatically from Polar webhooksNot includedIncluded
Renewal, cancellation and refund handlingNot includedIncluded
SQL storage and ready-made API routesNot includedIncluded
React license activation and upgrade promptNot includedIncluded
LicenceMITPer person
SupportGitHub issuesAgency and Lifetime

Pro

Pro packagesAdd-ons on top of the core.

Live demo

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-server

    License server: Polar webhooks, issuing, renewing and revoking licenses, SQL storage and a fetch handler.

  • @weber-development/integral-portal

    React 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
Subscribe

Agency

Recommended

For teams of up to ten named people, one price.

CHF 390

per year

2 months free

  • Up to 10 people
  • Support included
Subscribe

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
Buy lifetime licence

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.
Read the licence terms

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.

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

ArticlesGuides and release notes.