# evoleap-licensing

> Client API for elm

Latest version **0.7.108** (published 2026-03-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install evoleap-licensing
pnpm add evoleap-licensing
yarn add evoleap-licensing
bun add evoleap-licensing
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.7.108 |
| Published | 2026-03-19 |
| First published | 2022-10-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 8 |
| Unpacked size | 845.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | evoleap |

## Links

- npm: https://www.npmjs.com/package/evoleap-licensing
- Repository: https://github.com/evoleap/evoleap.licensing.js
- npm.io page: https://npm.io/package/evoleap-licensing

## Dependencies (8)

- [axios](https://npm.io/package/axios.md) ^1.13.2
- [sinon](https://npm.io/package/sinon.md) ^14.0.0
- [node-rsa](https://npm.io/package/node-rsa.md) ^1.1.1
- [crypto-js](https://npm.io/package/crypto-js.md) ^4.1.1
- [drivelist](https://npm.io/package/drivelist.md) 11.0.0
- [node-forge](https://npm.io/package/node-forge.md) ^1.3.1
- [@types/sinon](https://npm.io/package/@types/sinon.md) ^10.0.13
- [@bitauth/libauth](https://npm.io/package/@bitauth/libauth.md) ^1.17.1

## Recent versions

- 0.7.108 (latest) — 2026-03-19
- 0.7.98 — 2026-03-17
- 0.7.97 — 2026-03-17
- 0.7.88 — 2025-11-17
- 0.7.79 — 2025-09-26
- 0.7.74 — 2025-08-19
- 0.7.72 — 2025-07-01
- 0.7.70 — 2024-11-08
- 0.7.67 — 2024-11-07
- 0.7.64 — 2022-11-02
- 0.7.63 — 2022-10-27
- 0.7.62 — 2022-10-26
- 0.7.60 — 2022-10-26

## README

# evoleap-licensing

## Client API for elm

This library includes code required to interact with evoleap license manager
(https://elm.evoleap.com) for managing servers with users (usually web server applications)

## Getting Started

After acquiring an elm login from evoleap, you can set up products. You will need:

- A Product ID
- One or more version numbers
- A public key for your product

After a product is set up, you can set up licenses in the elm portal. Each license has a unique
license key.

## Registering a license

To use elm, first import the elm library:

```
const elm = require('evoleap-licensing');
```

or

```
import * as elm from 'evoleap-licensing';
```

Next, on server startup, register the elm server by calling:

```
function getDefaultServerState() {
	return {
		registered: false,
		registeredAt: '',
		failedRegistrationTimes: [],
		failedValidationTimes: [],
		featureGroups: [],
		features: [],
		firstLaunchTime: '',
		gracePeriodForValidationFailures: 0,
		instanceId: '',
		lastSuccessfulValidationTime: '',
		lastValidationStatus: 0,
	};
}

const emptyInstanceIdentity = {
	MaximumMismatchCount: 1,
	Values: new Map(),
	Version: 1,
};

const productId = '818FE2BC-6D57-4BF9-AB89-B94684FC1185';

const version = '1.0';

const publicKey = `-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyfhD/yW2quaZYHGeXOHQ
MAWxZ7QWLnKq9fs23LAd2ERTcAYRnz1GsLcTMUNHpdrUwsnzAduiw/DFPT9i0IOX
GQpCZcvfQO6YXAsNKna7Q1/3LVM6IHLyjAEdLWGF2USUENRIIOfkk5WyJxsHdXS9
jt+1Nt7z9KKZ1tpZS8ixxKH5Eaew/5y9D3XtP6H6nBXT7I7G7BMeAdJ2pfzfwAlD
kyRQs09qL/qK1DAyJKxS8GV6zLUMpoKBqy+7x5shO3SYIp+opUu7gnqYuWFS7K+n
UGdrrzUyRip2z4eLUj8TwmxXNVfn9Ci/TFW05eiIWd7NT8cTL5761BgJj2wbe0F2
HQIDAQAB
-----END PUBLIC KEY-----`;

const licenseKey = '02TRD-TYQZA-11DO4-238L6-91JOZ';

const licenseState = elm.server.getServerControlManager(
    productId,
    version,
    publicKey,
    getDefaultServerState(),
    elmPrefix
);

elm.hardware.addAllHardwareKeys(emptyInstanceIdentity)
    .then((instanceIdentity) => {
        elm.server.registerServer(
            licenseKey,
            licenseState,
            instanceIdentity
        ))
            .then((registrationResult) => {
				if (!registrationResult.success) {
					console.log(`Server registration was unsuccessful: ${registrationResult.message}`);
				} else {
					console.log('elm server registration successful!');
					// Updated state is in registrationResult.state

                    elm.server.validateInstance(registrationResult.state, instanceIdentity)
                        .then((instanceValidity) => {
                            if (!instanceValidity || !instanceValidity.isValid) {
                                if (!instanceValidity) {
                                    console.log('Server instance validation failed: unknown reason');
                                } else {
                                    console.log(`Server instance validation failed: ${elm.state.InvalidReason[instanceValidity.InvalidReason]}`);
                                }
                            } else {
                                console.log('elm server instance valid!');
                            }
                        })
                        .catch((err) => {
                            console.log(`Licensing error validating instance ${err}`);
                        });
                }
            })
            .catch((err) => {
                console.log(`Licensing error registering instance ${err}`);
            });
    })
    .catch((err) => {
        console.log(`Licensing error adding hardware keys ${err}`);
    });
```

---
_Source: https://npm.io/package/evoleap-licensing · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
