SDKs
node.js SDK
Bundle Manager
16 min
bundle manager provides a high level interface for managing bundle licenses, including local bundle licenses the bundlemanager is required to work with local bundle license files this class can share the same license file with the licensemanager, as both classes are designed to not overwrite each other's data typescript definitions are provided for the arguments and return types of the class methods to import the bundlemanager class use const { bundlemanager } = require('@licensespring/node sdk'); to create an instance const bundlemanager = new bundlemanager({ apikey '12345678 4bfe 4e3a 8737 757004d6294c', sharedkey 'eyuhrlajvivtisfixpxpkhw78f4ewy 00 12345678', appname 'js sdk test 1', appversion '0 0 1', productcode 'bkp', / 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, / a custom provided hardware id (overrides hwid calculation) / hardwareid? string, } methods methods listed here which take a license payload are the similar to corresponding methods in the license api class, except that product and hardware id do not have to be specified in the payload as they are provided by the bundle manager object check bundle license see check bundle docid\ odudsbu1bnxycgt4zx8fw checkbundle( payload checkbundlepayload, includeexpiredfeatures boolean = false ) promise\<checklicenseresponse\[]> type checklicensepayload = ({ username string; } | { license key string; }) & { env string | undefined; license id number | undefined; sdk ver string | undefined; app ver string | undefined; hostname string | undefined; os hostname string | undefined; ip local string | undefined; mac address string | undefined; ip string | undefined; os ver string | undefined; channel string | undefined; }; type checklicenseresponse = { id number, allow grace period boolean, allow overages boolean, allow unlimited activations boolean, allow offline activation boolean, can borrow boolean, custom fields customfield\[], customer customerresponse, enable maintenance period boolean, floating timeout number, floating users? number, grace period number | null, is air gapped boolean, is floating boolean, is floating cloud boolean, is hardware key auth boolean, license key string | undefined, license template id? number, maintenance period string | null, max activations number, max borrow time number, max license users? number, max overages number, max transfers? number, metadata jsonobjectrequired, metadata string? string, order store id? string, prevent vm boolean, company { id number, }, product details? productdetailsresponse, product features featureresponse\[], start date string | null, times activated number, transfer count number, validity period string | null, is trial boolean, trial days? number, user? licenseuserresponse, license type licensetypes, allow negative consumptions? boolean, allow unlimited consumptions? boolean, consumption period? 'daily' | 'weekly' | 'monthly' | 'annually' | null, max consumptions? number, reset consumption? boolean, total consumptions? number, borrowed until string | null, floating in use devices? number, is borrowed boolean, is expired boolean, license active boolean, license enabled boolean, license signature string, }; activate bundle license online see activate bundle (online method) docid\ sj4ujbbdqwmf3qjdvnhdh activatebundle(payload activatebundlepayload) promise\<activatelicenseresponse\[]> type activatebundlepayload = ({ license key string; } | { username string; password string; } | { code string; customer account code string; } | { id token string; customer account code string; }) & { variables { \[key string] string | number | boolean } | undefined; }; type activatelicenseresponse = { id number, allow grace period boolean, allow overages boolean, allow unlimited activations boolean, allow offline activation boolean, can borrow boolean, custom fields customfield\[], customer customerresponse, enable maintenance period boolean, floating timeout number, floating users? number, grace period number | null, is air gapped boolean, is floating boolean, is floating cloud boolean, is hardware key auth boolean, license key string | undefined, license template id? number, maintenance period string | null, max activations number, max borrow time number, max license users? number, max overages number, max transfers? number, metadata jsonobjectrequired, metadata string? string, order store id? string, prevent vm boolean, company { id number, }, product details? productdetailsresponse, product features featureresponse\[], start date string | null, times activated number, transfer count number, validity period string | null, is trial boolean, trial days? number, user? licenseuserresponse, license type licensetypes, allow negative consumptions? boolean, allow unlimited consumptions? boolean, consumption period? 'daily' | 'weekly' | 'monthly' | 'annually' | null, max consumptions? number, reset consumption? boolean, total consumptions? number, request string, active boolean, device id number, validity period string | null, is expired boolean, hardware id string, username? string, max license users? number, is floating cloud boolean, floating in use? boolean, license signature string, variables? ({ value string; device id number; variable string; created at string | null; })\[]; }; deactivate license online see deactivate bundle (online method) docid\ nzu6srynqlled2 hhvhr deactivatebundle(payload ({ username string; } | { license key string; }) promise\<boolean> activate bundle license offline see activate bundle (offline method) docid 0awea7jlugzt14z9 qsqi activateoffline(payload string) promise\<activateofflineresponse> type activateofflineresponse = { id number, allow grace period boolean, allow overages boolean, allow unlimited activations boolean, allow offline activation boolean, can borrow boolean, custom fields customfield\[], customer customerresponse, enable maintenance period boolean, floating timeout number, floating users? number, grace period number | null, is air gapped boolean, is floating boolean, is floating cloud boolean, is hardware key auth boolean, license key string | undefined, license template id? number, maintenance period string | null, max activations number, max borrow time number, max license users? number, max overages number, max transfers? number, metadata jsonobjectrequired, metadata string? string, order store id? string, prevent vm boolean, company { id number, }, product details? productdetailsresponse, product features featureresponse\[], start date string | null, times activated number, transfer count number, validity period string | null, is trial boolean, trial days? number, user? licenseuserresponse, license type licensetypes, allow negative consumptions? boolean, allow unlimited consumptions? boolean, consumption period? 'daily' | 'weekly' | 'monthly' | 'annually' | null, max consumptions? number, reset consumption? boolean, total consumptions? number, request string, active boolean, device id number, validity period string | null, is expired boolean, hardware id string, username? string, max license users? number, is floating cloud boolean, floating in use? boolean, license signature string, variables? ({ value string; device id number; variable string; created at string | null; })\[]; date string, offline signature string, license signature v2 string, }; deactivate bundle license offline performs an offline deactivation deactivateoffline() promise\<boolean> change password see change password docid\ b4ixyzvah4talttuuajyi changepassword(payload { username string; password string; new password string; }) promise\<boolean> get product versions see get product versions docid\ mbq0ek4xlt jx8sldyhy9 getversions(payload getversionspayload) promise\<versionsresponse> type getversionspayload = ({ license key string; } | { username string; }) & { sdk ver string | undefined; env string | undefined; channel string | undefined; }; type versionsresponse = ({ version string | undefined; release date string | null; })\[]; get product installation file see get installation file docid\ lxpe6kv olj7hll grl1q getinstallationfile(payload getinstallationfilepayload) promise\<installationfileresponse> type getinstallationfilepayload = ({ license key string; } | { username string; }) & { sdk ver string | undefined; env string | undefined; channel string | undefined; version string | undefined; }; type installationfileresponse = { id number; version string | undefined; installation file string | undefined; release date string | null; hash md5 string | undefined; environment string; eula link string | undefined; release notes link string | undefined; size string | undefined; requires version string | undefined; channel string | undefined; company { id number; }; }; get single sign on url see single sign on url docid\ qbjwnphsdcs0l25uw6ptq getssourl(payload { response type 'token' | 'code' | undefined; product string; customer account code string; }) promise\<ssourlresponse> type ssourlresponse = { url string; openid configuration { \[key string] string | number | boolean; }; }; license utility methods the following methods on the bundlemanager class take a single argument which is the license object returned from a license activation, a license check or parsed from the license file checks if license is enabled, active and not expired isvalid(license { license active boolean, license enabled boolean, validity period dateiso8601utc | null, }) boolean returns days remaining in maintenance period maintenancedaysremaining(license { enable maintenance period boolean maintenance period string | null, }) number returns days remaining in license validity period daysremaining(license { grace period number, validity period dateiso8601utc | null, }) number license file see license file https //www npmjs com/package/@licensespring/node sdk#license file / reads and parses the local license file and returns its data as a license object / loadbundle() license / verifies the local bundle license file's integrity / islicensefilecorrupted() boolean / deletes the local bundle license file and guard file / clearlocalstorage() void