SDKs
node.js SDK

License Manager

29min
licensemanager provides a high level interface for managing licenses, including local licenses the licensemanager is required to work with local license files typescript definitions are provided for the arguments and return types of the class methods to import the licensemanager class use const { licensemanager } = require('@licensespring/node sdk'); to create an instance const licensemanager = new licensemanager({ apikey '12345678 4bfe 4e3a 8737 757004d6294c', sharedkey 'eyuhrlajvivtisfixpxpkhw78f4ewy 00 12345678', appname 'js sdk test 1', appversion '0 0 1', productcode 'lkp', / note the following properties are set to their default values by the sdk and can be overriden manually / // apipath 'http //api dev licensespring com/api/v4', // publickey ' ', }); the constructor takes the a single argument of the following type { / your licensespring api key / apikey string, / your licensespring api shared key / sharedkey string, / custom name for your application / appname string, / custom version string for your application / appversion string, / your product short code / productcode string, / your air gap activation key (optional) / airgapkey? string, / override for license api url (default is https //api licensespring com/api/v4/) / apipath? string, / override for license api public key (default is pub key for api licensespring com) / publickey? string, / override for license file filename (default is "license") / filename? string, / override for license file path (default is current directory) / filepath? string, / override for license file encryption key / filekey? string, / override for license grace period duration in hours (default is 24) / graceperiod? number, / override for license file guard file (default is false) / isguardfileenabled? boolean, / override for hardware id calculation method (default is 0, for more info see "hardware id" section) / hardwareidmethod? number, } methods methods that take a managed license identificator are the same as in license api, except that product and hardware id do not have to be specified in the payload as they are provided by the license manager object check license https //docs licensespring com/license api/check https //docs licensespring com/license api/check checklicense(payload managed\<licenseidentificator>) promise\<licenseresponse> activate license online https //docs licensespring com/license api/activation deactivation/activation https //docs licensespring com/license api/activation deactivation/activation activatelicense(payload managed\<licenseidentificatorwithvariables>) promise\<licenseresponse> deactivate license online https //docs licensespring com/license api/activation deactivation/deactivation https //docs licensespring com/license api/activation deactivation/deactivation deactivatelicense(payload managed\<licenseidentificator>) promise\<boolean> activate license offline https //docs licensespring com/license api/activation deactivation/offline activation https //docs licensespring com/license api/activation deactivation/offline activation activateoffline(payload managed\<licenseidentificatorofflinewithvariables>) promise\<licenseresponseoffline> deactivate license offline https //docs licensespring com/license api/activation deactivation/offline deactivation https //docs licensespring com/license api/activation deactivation/offline deactivation deactivateoffline(payload managed\<licenseidentificator>) promise\<boolean> get trial key https //docs licensespring com/license api/trial key https //docs licensespring com/license api/trial key gettrialkey(payload managed\<trialkeypayload>) promise\<licensetrialresponse> list licenses for user https //docs licensespring com/license api/user licenses https //docs licensespring com/license api/user licenses getuserlicenses(payload managed\<getuserlicensespayload>) promise\<licenseresponse\[]> list license users for customer https //docs licensespring com/license api/customer license users https //docs licensespring com/license api/customer license users getcustomerlicenseusers(payload managed\<getcustomerlicensespayload>) promise\<customerlicenseusersresponse> check license feature https //docs licensespring com/license api/license feature check https //docs licensespring com/license api/license feature check checklicensefeature(payload managed\<licenseidentificatorandfeature>) promise\<licensefeatureresponse> add license consumption https //docs licensespring com/license api/consumption/add https //docs licensespring com/license api/consumption/add addconsumption(payload managed\<licenseidentificatoraddconsumptions>) promise\<licenseconsumptionsresponse> add feature consumption https //docs licensespring com/license api/consumption/add feature https //docs licensespring com/license api/consumption/add feature addfeatureconsumption(payload managed\<licenseidentificatoraddfeatureconsumptions>) promise\<licensefeatureconsumptionresponse> get product details https //docs licensespring com/license api/product details https //docs licensespring com/license api/product details getproductdetails(payload managed\<productdetailspayload>) promise\<productdetailsresponse> get device variables https //docs licensespring com/license api/device variables/get https //docs licensespring com/license api/device variables/get getdevicevariables(payload managed\<licenseidentificator>) promise\<devicevariable\[]> track device variables https //docs licensespring com/license api/device variables/track https //docs licensespring com/license api/device variables/track trackdevicevariables(payload managed\<licenseidentificatorwithvariables>) promise\<devicevariable\[]> borrow floating license https //docs licensespring com/license api/floating/license/borrow https //docs licensespring com/license api/floating/license/borrow floatingborrow(payload managed\<licenseidentificatorwithborroweduntil>) promise\<licenseborrowresponse> release floating license https //docs licensespring com/license api/floating/license/release https //docs licensespring com/license api/floating/license/release floatingrelease(payload managed\<licenseidentificator>) promise\<boolean> release floating feature https //docs licensespring com/license api/floating/feature/release https //docs licensespring com/license api/floating/feature/release featurerelease(payload managed\<licenseidentificatorandfeature>) promise\<boolean> change password https //docs licensespring com/license api/change password https //docs licensespring com/license api/change password changepassword(payload passwordchangepayload) promise\<boolean> get product versions https //docs licensespring com/license api/versions https //docs licensespring com/license api/versions getversions(payload managed\<licenseidentificator>) promise\<versionsresponse> get product installation file https //docs licensespring com/license api/installation file https //docs licensespring com/license api/installation file getinstallationfile(payload managed\<licenseidentificatorwithinstallation>) promise\<installationfileresponse> get single sign on url https //docs licensespring com/license api/sso url https //docs licensespring com/license api/sso url getssourl(payload ssourlparams) promise<{ url string }> air gapped licenses https //docs licensespring com/license entitlements/activation types/air gapped https //docs licensespring com/license entitlements/activation types/air gapped getairgapactivationcode(initializationcode string, licensekey string) performs verifyconfirmationcode and activates air gapped license activateairgaplicense(confirmationcode string, licensekey string, policyfilepath string, policyid string) license utility methods checks if license is enabled, active and not expired isvalid(license licenseresponse) boolean returns days remaining in maintenance period maintenancedaysremaining(license licenseresponse) number returns days remaining in license validity period daysremaining(license licenseresponse) number license file see license file https //www npmjs com/package/@licensespring/node sdk#license file loadlicense() license islicensefilecorrupted() boolean clearlocalstorage() void