Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@lefe-dev/lefe-verify-license
Advanced tools
@lefe-dev/lefe-verify-license
A library to verify license keys, display watermarks for trial versions, and manage license information for the Lefe platform.
Install via npm:
npm install @lefe-dev/lefe-verify-license
import { LicenseVerifier } from "@lefe-dev/lefe-verify-license";
const licenseVerifier = new LicenseVerifier({
scopes: [{ name: "your-package-name" }],
organization: "your-organization-name",
});
const result = licenseVerifier.verifyLicense({
licenseKey: "customer-license-key",
packageScope: "your-package-name",
});
console.log(result.status);
import { showWatermark } from "@lefe-dev/lefe-verify-license";
showWatermark(result.status, "block", {
parent: document.body,
width: 100,
height: 100,
});
import { LicenseInfo } from "@lefe-dev/lefe-verify-license";
const licenseInfo = new LicenseInfo({
organization: "your-organization-name",
});
licenseInfo.setLicenseKey("customer-license-key");
const key = licenseInfo.getLicenseKey();
LicenseVerifier
constructor({ scopes, organization })
ScopesTree
- A tree structure defining the scopes of licenses.Organization
- The name of the organization managing the license.Example:
const licenseVerifier = new LicenseVerifier({
scopes: [
{ name: "pro", children: [{ name: "package-one" }] },
{
name: "premium",
children: [{ name: "package-two" }, { name: "package-three" }],
},
],
organization: "your-org-name",
});
verifyLicense({ licenseKey, packageScope })
string
- The license key to be verified.ScopeName
- The scope of the package being verified.Returns: { status: LicenseStatus; meta?: object }
LicenseStatus
- The result of the license verification NotFound
, Invalid
, ExpiredSubscription
, ExpiredSubscriptionGrace
, Valid
, OutOfScope
object
(optional) - Additional metadata about the license verification result.Example:
licenseVerifier.verifyLicense({
licenseKey: "customer-license-key",
packageScope: "pro",
});
showWatermark
showWatermark(status, type, options)
LicenseStatus
- The license status to check.string
- Type of watermark.
'image'
, 'block'
WatermarkOptions | ImageWatermarkOptions
- Options for watermark customization.
HTMLElement
- The parent element to attach the watermark.number
- The width of the watermark.number
- The height of the watermark.string
(optional) - Controls the repetition of the watermark background.number
(optional) - Rotation angle of the watermark.Check watermark-js-plus package for more info.
LicenseInfo
constructor({ organization })
Organization
- The name of the organization for which the license is managed.Example:
const licenseInfo = new LicenseInfo({
organization: "your-organization-name",
});
getLicenseKey()
License["key"]
- The current license key.Example:
const key = licenseInfo.getLicenseKey();
console.log(key); // Outputs the current license key
setLicenseKey(key)
string
(optional) - The new license key to set.Example:
licenseInfo.setLicenseKey("new-license-key");
Licensed under MIT.
FAQs
Verify lefe license
The npm package @lefe-dev/lefe-verify-license receives a total of 726 weekly downloads. As such, @lefe-dev/lefe-verify-license popularity was classified as not popular.
We found that @lefe-dev/lefe-verify-license demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.