License API

Provides a direct interface to the LicenseSpring APIarrow-up-right. The LicenseAPI class encapsulates API calls, input checks, authentication and signature verification. Typescript definitions are provided for the arguments and return types of the class methods.

To import the LicenseAPI class use:

example.js
const { LicenseAPI } = require('@licensespring/node-sdk');

Creating an instance

example.js
const licenseAPI = new LicenseAPI({
  apiKey: '12345678-4bfe-4e3a-8737-757004d6294c',
  sharedKey: 'eYuHrlajvIVTiSFIXpxpKhw78f4Ewy-00-12345678',
  appName: 'js-sdk-test-1',
  appVersion: '0.0.1',
  /** 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 a single argument of the following type:

types.ts
{
  /** 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 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,
}

API methods

For type declarations see Type Declarationsarrow-up-right.

Hardware ID

Generates a Hardware IDarrow-up-right. This value is required for various API method calls.

If the optional argument is not provided, it defaults to the value set in the configuration object provided when instantiating the LicensespringAPI object. If no value was provided in the config object, it defaults to 0 (the default Hardware ID method).

Check License

See: Check License

Check License Offline

Checks an offline license file

Check Bundle

See: Check Bundle

Check Bundle Offline

Checks an offline bundle license file

Activate License Online

See: Activate License (Online Method)

Deactivate License Online

See: Deactivate License (Online Method)

Activate License Offline

See: Activate License (Offline Method)

Deactivate License Offline

See: Deactivate License (Offline Method)

Activate Bundle Online

See: Activate Bundle (Online Method)

Deactivate Bundle Online

See: Deactivate Bundle (Online Method)

Get Trial Key

See: Trial Key

List Licenses for User

See: Licenses for User

List License Users for Customer

See: List License Users for Customer

Check License Feature

See: License Feature Check

Add License Consumption

See: Add Consumption

Add License Feature Consumption

See: Add Feature Consumption

Get Product Details

See: Get Product Details

Get Device Variables

See: Get Device Variables

Track Device Variables

See: Track Device Variables

Borrow Floating License

See: Borrow Floating License

Release Floating License

See: Release Floating License

Release Floating Feature

See: Release Floating Feature

Change Password

See: Change Password

Get Product Versions

See: Get Product Versions

Get Product Installation File

See: Get Installation File

Get Single Sign-On URL

See: Single Sign On URL

Air-Gapped License Code

https://docs.licensespring.com/license-entitlements/activation-types/air-gappedarrow-up-right

Last updated

Was this helpful?