# License Manager

### LicenseManager

Provides a high-level interface for managing licenses, including local licenses. The LicenseManager is required to work with local license files. Typescript definitions are provided for the arguments and return types of the class methods.

To import the LicenseManager class use:

{% code title="import.js" %}

```javascript
const { LicenseManager } = require('@licensespring/node-sdk');
```

{% endcode %}

To create an instance:

{% code title="create-instance.js" %}

```javascript
const licenseManager = new LicenseManager({
  apiKey: '12345678-4bfe-4e3a-8737-757004d6294c',
  sharedKey: 'eYuHrlajvIVTiSFIXpxpKhw78f4Ewy-00-12345678',
  appName: 'js-sdk-test-1',
  appVersion: '0.0.1',
  productCode: 'lkp',
  /** 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: '...',
});
```

{% endcode %}

The constructor takes the a single argument of the following type:

```typescript
{
  /** 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 product short code */
  productCode: 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,
}
```

### Methods

Methods listed here which take a license payload are the similar to corresponding methods in the License API class, except that `product` and `hardware_id` do not have to be specified in the payload as they are provided by the License Manager object.

#### Check License

See: [**Check License**](/license-api/license-check/check-license.md)

```typescript
checkLicense(
  payload: CheckLicensePayload, 
  includeExpiredFeatures: boolean = false
): Promise<CheckLicenseResponse>

type CheckLicensePayload = ({
  username: string;
} | {
  license_key: string;
}) & {
  env: string | undefined;
  license_id: number | undefined;
  sdk_ver: string | undefined;
  app_ver: string | undefined;
  hostname: string | undefined;
  os_hostname: string | undefined;
  ip_local: string | undefined;
  mac_address: string | undefined;
  ip: string | undefined;
  os_ver: string | undefined;
  channel: string | undefined;
};

type CheckLicenseResponse = {
  id: number,
  allow_grace_period: boolean,
  allow_overages: boolean,
  allow_unlimited_activations: boolean,
  allow_offline_activation: boolean,
  can_borrow: boolean,
  custom_fields: CustomField[],
  customer: CustomerResponse,
  enable_maintenance_period: boolean,
  floating_timeout: number,
  floating_users?: number,
  grace_period: number | null,
  is_air_gapped: boolean,
  is_floating: boolean,
  is_floating_cloud: boolean,
  is_hardware_key_auth: boolean,
  license_key: string | undefined,
  license_template_id?: number,
  maintenance_period: string | null,
  max_activations: number,
  max_borrow_time: number,
  max_license_users?: number,
  max_overages: number,
  max_transfers?: number,
  metadata: JSONObjectRequired,
  metadata_string?: string,
  order_store_id?: string,
  prevent_vm: boolean,
  company: {
    id: number,
  },
  product_details?: ProductDetailsResponse,
  product_features: FeatureResponse[],
  start_date: string | null,
  times_activated: number,
  transfer_count: number,
  validity_period: string | null,
  is_trial: boolean,
  trial_days?: number,
  user?: LicenseUserResponse,
  license_type: LicenseTypes,
  allow_negative_consumptions?: boolean,
  allow_unlimited_consumptions?: boolean,
  consumption_period?: 'daily' | 'weekly' | 'monthly' | 'annually' | null,
  max_consumptions?: number,
  reset_consumption?: boolean,
  total_consumptions?: number,
  borrowed_until: string | null,
  floating_in_use_devices?: number,
  is_borrowed: boolean,
  is_expired: boolean,
  license_active: boolean,
  license_enabled: boolean,
  license_signature: string,
};
```

#### Activate License Online

See: [**Activate License (Online Method)**](/license-api/license-activation-and-deactivation/activate-license-online-method.md)

```typescript
activateLicense(payload: ActivateLicensePayload): Promise<ActivateLicenseResponse>

type ActivateLicensePayload = ({ 
  license_key: string; 
} | {
  username: string;
  password: string;
} | {
  code: string;
  customer_account_code: string;
} | {
  id_token: string;
  customer_account_code: string;
}) & {
  variables: { [key: string]: string | number | boolean } | undefined;
};

type ActivateLicenseResponse = {
  id: number,
  allow_grace_period: boolean,
  allow_overages: boolean,
  allow_unlimited_activations: boolean,
  allow_offline_activation: boolean,
  can_borrow: boolean,
  custom_fields: CustomField[],
  customer: CustomerResponse,
  enable_maintenance_period: boolean,
  floating_timeout: number,
  floating_users?: number,
  grace_period: number | null,
  is_air_gapped: boolean,
  is_floating: boolean,
  is_floating_cloud: boolean,
  is_hardware_key_auth: boolean,
  license_key: string | undefined,
  license_template_id?: number,
  maintenance_period: string | null,
  max_activations: number,
  max_borrow_time: number,
  max_license_users?: number,
  max_overages: number,
  max_transfers?: number,
  metadata: JSONObjectRequired,
  metadata_string?: string,
  order_store_id?: string,
  prevent_vm: boolean,
  company: {
    id: number,
  },
  product_details?: ProductDetailsResponse,
  product_features: FeatureResponse[],
  start_date: string | null,
  times_activated: number,
  transfer_count: number,
  validity_period: string | null,
  is_trial: boolean,
  trial_days?: number,
  user?: LicenseUserResponse,
  license_type: LicenseTypes,
  allow_negative_consumptions?: boolean,
  allow_unlimited_consumptions?: boolean,
  consumption_period?: 'daily' | 'weekly' | 'monthly' | 'annually' | null,
  max_consumptions?: number,
  reset_consumption?: boolean,
  total_consumptions?: number,
  request: string,
  active: boolean,
  device_id: number,
  validity_period: string | null,
  is_expired: boolean,
  hardware_id: string,
  username?: string,
  max_license_users?: number,
  is_floating_cloud: boolean,
  floating_in_use?: boolean,
  license_signature: string,
  variables?: ({
    value: string;
    device_id: number;
    variable: string;
    created_at: string | null;
  })[];
};
```

#### Deactivate License Online

See: [**Deactivate License (Online Method)**](/license-api/license-activation-and-deactivation/deactivate-license-online-method.md)

```typescript
deactivateLicense(payload: ({  
  username: string;
} | {
  license_key: string;
}): Promise<boolean>
```

#### Activate License Offline

See: [**Activate License (Offline Method)**](/license-api/license-activation-and-deactivation/activate-license-offline-method.md)

```typescript
activateOffline(payload: string): Promise<ActivateOfflineResponse>

type ActivateOfflineResponse = {
  id: number,
  allow_grace_period: boolean,
  allow_overages: boolean,
  allow_unlimited_activations: boolean,
  allow_offline_activation: boolean,
  can_borrow: boolean,
  custom_fields: CustomField[],
  customer: CustomerResponse,
  enable_maintenance_period: boolean,
  floating_timeout: number,
  floating_users?: number,
  grace_period: number | null,
  is_air_gapped: boolean,
  is_floating: boolean,
  is_floating_cloud: boolean,
  is_hardware_key_auth: boolean,
  license_key: string | undefined,
  license_template_id?: number,
  maintenance_period: string | null,
  max_activations: number,
  max_borrow_time: number,
  max_license_users?: number,
  max_overages: number,
  max_transfers?: number,
  metadata: JSONObjectRequired,
  metadata_string?: string,
  order_store_id?: string,
  prevent_vm: boolean,
  company: {
    id: number,
  },
  product_details?: ProductDetailsResponse,
  product_features: FeatureResponse[],
  start_date: string | null,
  times_activated: number,
  transfer_count: number,
  validity_period: string | null,
  is_trial: boolean,
  trial_days?: number,
  user?: LicenseUserResponse,
  license_type: LicenseTypes,
  allow_negative_consumptions?: boolean,
  allow_unlimited_consumptions?: boolean,
  consumption_period?: 'daily' | 'weekly' | 'monthly' | 'annually' | null,
  max_consumptions?: number,
  reset_consumption?: boolean,
  total_consumptions?: number,
  request: string,
  active: boolean,
  device_id: number,
  validity_period: string | null,
  is_expired: boolean,
  hardware_id: string,
  username?: string,
  max_license_users?: number,
  is_floating_cloud: boolean,
  floating_in_use?: boolean,
  license_signature: string,
  variables?: ({
    value: string;
    device_id: number;
    variable: string;
    created_at: string | null;
  })[];
  date: string,
  offline_signature: string,
  license_signature_v2: string,
};
```

#### Deactivate License Offline

Performs an offline deactivation

```typescript
deactivateOffline(): Promise<boolean>
```

#### Get Trial Key

See: [**Trial Key**](/license-api/trial-key.md)

```typescript
getTrialKey(payload: GetTrialKeyPayload): Promise<TrialResponse>

type GetTrialKeyPayload = {
    sdk_ver: string | undefined;
    email: string | undefined;
    license_policy: string | undefined;
    first_name: string | undefined;
    last_name: string | undefined;
    phone: string | undefined;
    address: string | undefined;
    postcode: string | undefined;
    state: string | undefined;
    country: string | undefined;
    city: string | undefined;
    reference: string | undefined;
    company_name: string | undefined;
};

type TrialResponse = TrialExistingResponse | TrialNewResponse;

type TrialExistingResponse = {
  license_type: LicenseTypes,
  is_trial: boolean,
  license: string,
} | {
  license_type: LicenseTypes,
  is_trial: boolean,
  license_user: string,
};

type TrialNewResponse = {
  id: number;
  order_id: number;
  product_id: number;
  created_at: number;
  updated_at: number;
  active: boolean;
  enable_maintenance_period: boolean;
  enabled: boolean;
  is_floating: boolean;
  is_hardware_key_auth: boolean;
  is_trial: boolean;
  license_type: LicenseTypes;
  maintenance_duration: string | null;
  max_activations: number;
  max_transfers: number;
  metadata_string: string | undefined;
  metadata: JSONObjectRequired,
  prevent_vm: boolean;
  times_activated: number;
  trial_days: number;
  validity_period?: string;
  company: {
    id: number;
  };
  LicenseProductFeatures: ({
    id: number;
    product_feature_id: number;
    max_consumption: number;
    allow_overages: boolean;
    max_overages: number;
    reset_consumption: boolean;
    consumption_period?: ConsumptionPeriod;
    is_floating: boolean;
    is_floating_cloud: boolean;
    metadata: JSONObjectRequired,
    metadata_string?: string;
    floating_timeout?: number;
    floating_users?: number;
  })[];
  LicenseCustomFields: ({
    product_custom_field_id: number;
    value: string | undefined;
  })[];
  is_floating_cloud: boolean;
  floating_users: number;
  floating_timeout: number;
  allow_overages: boolean;
  max_overages: number;
  max_consumptions: number;
  valid_duration: null;
  consumption_period: ConsumptionPeriod | null;
  reset_consumption?: boolean;
  grace_period: number;
  allow_grace_period: boolean;
} & ({
  license: string;
  license_key: string;
} | {
  license_user: string;
  initial_password: string;
  license_user_id: number | null;
  max_license_users: number;
});
```

#### List Licenses for User

See: [**Licenses for User**](/license-api/list-licenses/licenses-for-user.md)

```typescript
getUserLicenses(payload: GetUserLicensesPayload): Promise<GetUserLicensesResponse>

type GetUserLicensesPayload = { 
  license_key: string; 
} | {
  username: string;
  password: string;
} | {
  code: string;
  customer_account_code: string;
} | {
  id_token: string;
  customer_account_code: string;
};

type GetUserLicensesResponse = ({
  
  license: {
    id: number,
    allow_grace_period: boolean,
    allow_overages: boolean,
    allow_unlimited_activations: boolean,
    allow_offline_activation: boolean,
    can_borrow: boolean,
    custom_fields: CustomField[],
    customer: CustomerResponse,
    enable_maintenance_period: boolean,
    floating_timeout: number,
    floating_users?: number,
    grace_period: number | null,
    is_air_gapped: boolean,
    is_floating: boolean,
    is_floating_cloud: boolean,
    is_hardware_key_auth: boolean,
    license_key: string | undefined,
    license_template_id?: number,
    maintenance_period: string | null,
    max_activations: number,
    max_borrow_time: number,
    max_license_users?: number,
    max_overages: number,
    max_transfers?: number,
    metadata: JSONObjectRequired,
    metadata_string?: string,
    order_store_id?: string,
    prevent_vm: boolean,
    company: {
      id: number,
    },
    product_details?: ProductDetailsResponse,
    product_features: FeatureResponse[],
    start_date: string | null,
    times_activated: number,
    transfer_count: number,
    validity_period: string | null,
    is_trial: boolean,
    trial_days?: number,
    user?: LicenseUserResponse,
    license_type: LicenseTypes,
    allow_negative_consumptions?: boolean,
    allow_unlimited_consumptions?: boolean,
    consumption_period?: 'daily' | 'weekly' | 'monthly' | 'annually' | null,
    max_consumptions?: number,
    reset_consumption?: boolean,
    total_consumptions?: number,
    license_active: boolean,
    license_enabled: boolean,
  },
  
  user: {
    id: number,
    email: string,
    first_name: string,
    is_initial_password: boolean,
    last_name: string,
    phone_number: string,
    allow_unlimited_activations?: boolean,
    max_activations?: number,
    total_activations?: number,
  },
})[];
```

#### List License Users for Customer

See: [**List License Users for Customer**](/license-api/list-license-users-for-customer.md)

```typescript
getCustomerLicenseUsers(payload: {
    customer: string;
}): Promise<CustomerLicenseUsersResponse>

type CustomerLicenseUsersResponse = {
  company: {
    id: number;
  };
  customer: CustomerResponse;
  users: ({
    email: string | undefined;
    allow_unlimited_activations: boolean;
    first_name: string;
    initial_password: string;
    is_active: boolean;
    is_initial_password: boolean;
    last_name: string;
    license_id: number;
    max_activations: number;
    order_id: number;
    order_store_id: string;
    phone_number: string;
    total_activations: number;
  })[];
};
```

#### Check License Feature

See: [**License Feature Check**](/license-api/license-feature-check.md)

```typescript
checkLicenseFeature(payload: CheckLicenseFeaturePayload): Promise<CheckLicenseFeatureResponse>

type CheckLicenseFeaturePayload = ({
  license_key: string;
} | {
  username: string;
}) & {
  license_id: number | undefined;
  sdk_ver: string | undefined;
  include_metadata_string: boolean | undefined;
  feature: string;
};

type CheckLicenseFeatureResponse = {
  id: number;
  license_id: number;
  code: string;
  name: string;
  metadata: JSONObjectRequired,
  metadata_string?: string;
  is_floating: boolean;
  is_floating_cloud: boolean;
  floating_in_use_devices?: number;
  expiry_date: string | null;
  feature_type: 'activation';
} | {
  id: number;
  license_id: number;
  code: string;
  name: string;
  metadata: JSONObjectRequired,
  metadata_string?: string;
  is_floating: boolean;
  is_floating_cloud: boolean;
  floating_in_use_devices?: number;
  expiry_date: string | null;
  feature_type: 'consumption';
  consumption_period: ConsumptionPeriod;
  allow_negative_consumptions: boolean;
  allow_overages: boolean;
  allow_unlimited_consumptions: boolean;
  max_consumption: number;
  max_overages: number;
  reset_consumption: boolean;
  total_consumptions: number;
};
```

#### Add License Consumption

See: [**Add Consumption**](/license-api/consumption/add-consumption.md)

```typescript
addConsumption(payload: AddConsumptionPayload): Promise<AddConsumptionResponse>

type AddConsumptionPayload = ({
  license_key: string | undefined;
} | {
  username: string | undefined;
}) & {
  consumptions: number;
  sdk_ver: string | undefined;
  license_id: number | undefined;
  ignore_events: boolean | undefined;
  allow_overages: boolean | undefined;
  max_overages: number | undefined;
  event: ("consumption_add" | "offline_floating_consumptions_sync")[] | undefined;
};

type AddConsumptionResponse = {
  id: number;
  max_consumptions: number;
  allow_unlimited_consumptions: boolean;
  allow_negative_consumptions: boolean;
  allow_overages: boolean;
  max_overages: number;
  reset_consumption: boolean;
  consumption_period: ConsumptionPeriod | undefined;
  total_consumptions: number;
  company: {
    id: number;
  };
};
```

#### Add Feature Consumption

See: [**Add Feature Consumption**](/license-api/consumption/add-feature-consumption.md)

```typescript
addFeatureConsumption(payload: AddFeatureConsumptionPayload): Promise<AddFeatureConsumptionResponse>

type AddFeatureConsumptionPayload = ({
  license_key: string | undefined;
} | {
  username: string | undefined;
}) & {
  consumptions: number;
  feature: string;
  sdk_ver: string | undefined;
  license_id: number | undefined;
  ignore_events: boolean | undefined;
  allow_overages: boolean | undefined;
  max_overages: number | undefined;
  event: ("consumption_add" | "offline_floating_consumptions_sync")[] | undefined;
};

type AddFeatureConsumptionResponse = {
  id: number;
  license_id: number;
  company: {
    id: number;
  };
  total_consumptions: number;
  max_consumptions: number;
  allow_negative_consumptions: boolean;
  allow_unlimited_consumptions: boolean;
  allow_overages: boolean;
  max_overages: number;
  reset_consumption: boolean;
  consumption_period: ConsumptionPeriod;
  is_floating: boolean;
  is_floating_cloud: boolean;
  floating_timeout?: number;
  floating_users?: number;
};
```

#### Get Product Details

See: [**Get Product Details**](/license-api/products/get-product-details.md)

```typescript
getProductDetails(payload: ProductDetailsPayload): Promise<GetProductDetailsResponse>

type ProductDetailsPayload = {
    include_latest_version: boolean | undefined;
    include_custom_fields: boolean | undefined;
    env: string | undefined;
};

type GetProductDetailsResponse = {
  product_id: number,
  product_name: string,
  short_code: string,
  allow_trial: boolean,
  trial_days: number,
  authorization_method: AuthorizationMethod,
  floating_timeout: number,
  allow_overages: boolean,
  max_overages: number,
  prevent_vm: boolean,
  metadata: JSONObjectRequired,
  metadata_string?: string,
  company: {
    id: number
  },
  latest_version?: {
    id: number;
    version: string | undefined;
    full_link: string | undefined;
    filename: string | undefined;
    release_date: string | null;
    hash_md5: string | undefined;
    environment: string;
    eula_link: string | undefined;
    release_notes_link: string | undefined;
    size: string | undefined;
    requires_version: string | undefined;
    channel: string | undefined;
    created_at: string | null;
    updated_at: string | null;
    enabled: boolean;
    product_id: number;
  } | null,
  custom_fields?: { id: number, name: string, default_value: string }[]
};
```

#### Get Device Variables

See: [**Get Device Variables**](/license-api/device-variables/get-device-variables.md)

```typescript
getDeviceVariables(payload: GetDeviceVariablesPayload): Promise<GetDeviceVariablesResponse>

type GetDeviceVariablesPayload = ({
    license_key: string;
} | {
    username: string;
}) & {
    sdk_ver: string | undefined;
    license_id: number | undefined;
};

type GetDeviceVariablesResponse = {
  id: number;
  created_at: string;
  variable?: string;
  value?: string;
  device_id: number;
}[];
```

#### Track Device Variables

See: [**Track Device Variables**](/license-api/device-variables/track-device-variables.md)

```typescript
trackDeviceVariables(payload: TrackDeviceVariablesPayload): Promise<TrackDeviceVariablesResponse>

type TrackDeviceVariablesPayload = ({
    license_key: string;
} | {
    username: string;
}) & {
    variables: { [key: string]: string | number | boolean },
    sdk_ver: string | undefined;
    license_id: number | undefined;
};

type TrackDeviceVariablesResponse = {
  variable: string;
  value: string;
  device_id: number;
  created_at: number;
}[];
```

#### Borrow Floating License

See: [**Borrow Floating License**](/license-api/floating/license/borrow-floating-license.md)

```typescript
floatingBorrow(payload: FloatingBorrowPayload): Promise<FloatingBorrowResponse>

type FloatingBorrowPayload = ({
    license_key: string;
} | {
    username: string;
    password: string;
}) & {
    borrowed_until: string | null;
    sdk_ver: string | undefined;
    license_id: number | undefined;
};

type FloatingBorrowResponse = {
  borrowed_until: string | null;
  max_borrow_time: number;
  device_id: number;
  license_id: number;
  company: {
    id: number;
  };
};
```

#### Release Floating License

See: [**Release Floating License**](/license-api/floating/license/release-floating-license.md)

```typescript
floatingRelease(payload: FloatingReleasePayload): Promise<boolean>

type FloatingReleasePayload = ({
    license_key: string;
} | {
    username: string;
}) & {
    sdk_ver: string | undefined;
    license_id: number | undefined;
};
```

#### Release Floating Feature

See: [**Release Floating Feature**](/license-api/floating/features/release-floating-feature.md)

```typescript
featureRelease(payload: FloatingFeatureReleasePayload): Promise<boolean>

type FloatingFeatureReleasePayload = ({
    license_key: string;
} | {
    username: string;
}) & {
    feature: string;
    sdk_ver: string | undefined;
    license_id: number | undefined;
};
```

#### Change Password

See: [**Change Password**](/license-api/change-password.md)

```typescript
changePassword(payload: {
    username: string;
    password: string;
    new_password: string;
}): Promise<boolean>
```

#### Get Product Versions

See: [**Get Product Versions**](/license-api/get-product-versions.md)

```typescript
getVersions(payload: GetVersionsPayload): Promise<VersionsResponse>

type GetVersionsPayload = ({
    license_key: string;
} | {
    username: string;
}) & {
    sdk_ver: string | undefined;
    env: string | undefined;
    channel: string | undefined;
};

type VersionsResponse = ({
  version: string | undefined;
  release_date: string | null;
})[];
```

#### Get Product Installation File

See: [**Get Installation File**](/license-api/get-installation-file.md)

```typescript
getInstallationFile(payload: GetInstallationFilePayload): Promise<InstallationFileResponse>

type GetInstallationFilePayload = ({
    license_key: string;
} | {
    username: string;
}) & {
    sdk_ver: string | undefined;
    env: string | undefined;
    channel: string | undefined;
    version: string | undefined;
};

type InstallationFileResponse = {
  id: number;
  version: string | undefined;
  installation_file: string | undefined;
  release_date: string | null;
  hash_md5: string | undefined;
  environment: string;
  eula_link: string | undefined;
  release_notes_link: string | undefined;
  size: string | undefined;
  requires_version: string | undefined;
  channel: string | undefined;
  company: {
    id: number;
  };
};
```

#### Get Single Sign-On URL

See: [**Single Sign On URL**](/license-api/single-sign-on-url.md)

```typescript
getSSOUrl(payload: {
    response_type: 'token' | 'code' | undefined;
    product: string;
    customer_account_code: string;
}): Promise<SSOUrlResponse>

type SSOUrlResponse = {
  url: string;
  openid_configuration: {
    [key: string]: string | number | boolean;
  };
};
```

#### Air-Gapped Licenses

[**https://docs.licensespring.com/license-entitlements/activation-types/air-gapped**](https://docs.licensespring.com/license-entitlements/activation-types/air-gapped)

```typescript
getAirGapActivationCode(initializationCode: string, licenseKey: string)
```

Performs verifyConfirmationCode and activates Air-Gapped License:

```typescript
activateAirGapLicense(confirmationCode: string, licenseKey: string, policyFilePath: string, policyID: string)
```

#### License Utility Methods

The following methods on the LicenseManager class take a single argument which is the license object returned from a license activation, a license check or parsed from the license file.

Checks if License is enabled, active and not expired:

```typescript
isValid(license: {
    license_active: boolean,
    license_enabled: boolean,
    validity_period: DateISO8601UTC | null,
  }): boolean
```

Returns days remaining in maintenance period:

```typescript
maintenanceDaysRemaining(license: {
    enable_maintenance_period: boolean
    maintenance_period: string | null,
  }): number
```

Returns days remaining in license validity period:

```typescript
daysRemaining(license: {
    grace_period: number,
    validity_period: DateISO8601UTC | null,
  }): number
```

#### License File

See [**License File**](https://www.npmjs.com/package/@licensespring/node-sdk#license-file)

```typescript
/** Reads and parses the local license file and returns its data as a License object */
loadLicense(): License

/** Verifies the local license file's integrity */
isLicenseFileCorrupted(): boolean

/** Deletes the local license file and guard file */
clearLocalStorage(): void
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.licensespring.com/sdks/node.js-sdk/license-manager.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
