Skip to main content
This library contains helper methods to verify licenses in NodeJS. The repository is available at https://github.com/Cryptolens/cryptolens-nodejs

Installation

Example

Key Verification

To verify a license key, you can use the code below. The RSAPublicKey, token and the product id can be found on this page.

Offline activation (saving/loading licenses)

Assuming the license key verification was successful, we can save the result in a file so that we can use it instead of contacting Cryptolens. First, we need to add the reference to the helper methods:
We can now proceed and save it as a string.
When loading it back, we can use the code below:
If you want to make sure that the license file is not too old, you can specify the maximum number of days as shown below (after 30 days, this method will return null).