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);
});