Node JS software licensing

Getting started with license key verifications in Node JS

Installing the NodeJS SDK

The easiest way to add software licensing into your Node JS application is by installing our NodeJS SDK, available open source on GitHub. The SDK is available as a NPM package.

Example key verification

The code below verifies a license key with our API. This example is covered in more detail on this page. If your application needs to work offline, please use this code snippet instead.

const key = require('cryptolens').Key;
const Helpers = require('cryptolens').Helpers;

var RSAPubKey = "Your RSA Public key, which can be found here: https://app.cryptolens.io/User/Security";
var result = key.Activate(token="Access token with with Activate permission", RSAPubKey, ProductId=3349, Key="GEBNC-WZZJD-VJIHG-GCMVD", MachineCode=Helpers.GetMachineCode());

result.then(function(license) {

    // success
    
    // Please see https://app.cryptolens.io/docs/api/v3/model/LicenseKey for a complete list of parameters.
    console.log(license.Created);

}).catch(function(error) {
    // in case of an error, an Error object is returned.
    console.log(error.message);
});

For more information on how to obtain the parameters, please read more here.