License File
For more info see:
https://docs.licensespring.com/sdks/tutorials/best-practices/local-license-file
https://docs.licensespring.com/sdks/python/licensefile
To load a local license file, create an instance of LicenseManager and call the method loadLicense:
const licenseFile = licenseManager.loadLicense();The License class provides an interface for working with the License File.
Methods
Create Offline Request File
Creates an activate_offline.req or deactivate_offline.req file for offline activation/deactivation at the specified path:
createRequestFile(request: OfflineActivation, offlinePath: string)Type declaration for OfflineActivation:
interface OfflineActivation {
isActivation: boolean; // true for activation, false for deactivation
isGuardFileEnabled: boolean; // should a guard file be created
guard: any // guard file data if required, created using: licenseAPI.createActivationGuard(licenseKey)
data: { // license data
product: string,
hardware_id: string,
license_key?: string,
license_id?: number,
username?: string,
password?: string,
app_ver?: string,
os_ver?: string,
hostname?: string,
ip?: string,
is_vm?: boolean,
vm_info?: string,
mac_address?: string,
variables?: {
[key: string]: boolean | number | string
},
};
}Get Feature Data
Check License Status
Throws an exception if the license is disabled, inactive or expired
Perform Full License Check
Checks License status and saves to local license file
Air-Gap License Activation Code
For more info see: https://docs.licensespring.com/license-entitlements/activation-types/air-gapped
Deactivate License
Deactivates a License, updates local license file. Optionally deletes license file
Local License Check
Performs a local check using the local license file. Throws an exception if license is not valid
Change Password
Performs password change for user associated to License
Add Local Consumption
Adds a License consumption to the local license data
Add Local Feature Consumption
Adds a License feature consumption to the local license data
Sync License Feature Consumption
Sends a feature consumption request to the server and updates local data
Sync License Consumptions
Syncs local consumptions to server
Borrow Floating License
Release Floating License
Check Feature
Checks License Feature status, throws exception if not active
Release Borrowed Feature
Update Offline
Update local cache from Offline License File (at given path). Optionally reset local consumption value
Deactivate License Offline
Get Product Details
Retrieves Product Details from server:
Retrieve Product Details from local data:
Device Variables
Set custom variables to local data:
Send locally stored variables to server, optionally save to license file:
Get the value of a variable from local data:
Get all variables from local data:
Get all variables from server:
Getters
Was this helpful?