nodeJS SDK
About
Installation
npm i --save @licensespring/node-sdkInterface
LicenseAPI
const { LicenseAPI } = require('@licensespring/node-sdk');
const licenseAPI = new LicenseAPI({
apiKey: '12345678-4bfe-4e3a-8737-757004d6294c',
sharedKey: 'eYuHrlajvIVTiSFIXpxpKhw78f4Ewy-00-12345678',
appName: 'js-sdk-test-1',
appVersion: '0.0.1',
});
const licenseActivation = await licenseAPI.activateLicense({ license_key: 'string', product: 'string', hardware_id: 'string' });
const bundleActivation = await licenseAPI.activateBundle({ license_key: 'string', product: 'string', hardware_id: 'string' });
const licenseCheck = await licenseAPI.checkLicense({ license_key: 'string', product: 'string', hardware_id: 'string' });
const bundleCheck = await licenseAPI.checkBundle({ license_key: 'string', product: 'string', hardware_id: 'string' });
const addConsumption = await licenseAPI.addConsumption({ license_key: 'string', product: 'string', hardware_id: 'string', consumptions: 10 });
const addFeatureConsumption = await licenseAPI.addFeatureConsumption({ license_key: 'string', product: 'string', hardware_id: 'string', feature: 'string', consumptions: 10 });
const licenseFeatureCheck = await licenseAPI.checkLicenseFeature({ license_key: 'string', product: 'string', hardware_id: 'string', feature: 'string' });
const trackDeviceVariables = await licenseAPI.trackDeviceVariables({ license_key: 'string', product: 'string', hardware_id: 'string', variables: { key1: 'value1' } });
const getDeviceVariables = await licenseAPI.getDeviceVariables({ license_key: 'string', product: 'string', hardware_id: 'string' });
const licenseDeactivation = await licenseAPI.deactivateLicense({ license_key: 'string', product: 'string', hardware_id: 'string' });
const bundleDeactivation = await licenseAPI.deactivateBundle({ license_key: 'string', product: 'string', hardware_id: 'string' });
/* NOTE: the hardware_id value can be either generated by your app
* (eg. using custom-made hardware fingerprinting logic) or you
* can use the hardware ID module exposed by this class:
*/
const hardwareID = licenseAPI.getHardwareID();LicenseManager
BundleManager
LicenseFile
Was this helpful?