- activate - Activates a license key.
- deactivate - Deactivate a license key instance.
- validate - Validates a license key or instance.
Activate a license key for a specific device or instance. Register new activations and track usage limits.
import { Creem } from "creem";
const creem = new Creem({
apiKey: process.env["CREEM_API_KEY"] ?? "",
});
async function run() {
const result = await creem.licenses.activate({
key: "<key>",
instanceName: "<value>",
});
console.log(result);
}
run();The standalone function version of this method:
import { CreemCore } from "creem/core.js";
import { licensesActivate } from "creem/funcs/licensesActivate.js";
// Use `CreemCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const creem = new CreemCore({
apiKey: process.env["CREEM_API_KEY"] ?? "",
});
async function run() {
const res = await licensesActivate(creem, {
key: "<key>",
instanceName: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("licensesActivate failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
components.ActivateLicenseRequestEntity | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.LicenseEntity>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
Remove a device activation from a license key. Free up activation slots for new devices.
import { Creem } from "creem";
const creem = new Creem({
apiKey: process.env["CREEM_API_KEY"] ?? "",
});
async function run() {
const result = await creem.licenses.deactivate({
key: "<key>",
instanceId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { CreemCore } from "creem/core.js";
import { licensesDeactivate } from "creem/funcs/licensesDeactivate.js";
// Use `CreemCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const creem = new CreemCore({
apiKey: process.env["CREEM_API_KEY"] ?? "",
});
async function run() {
const res = await licensesDeactivate(creem, {
key: "<key>",
instanceId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("licensesDeactivate failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
components.DeactivateLicenseRequestEntity | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.LicenseEntity>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
Verify if a license key is valid and active for a specific instance. Check activation status and expiration.
import { Creem } from "creem";
const creem = new Creem({
apiKey: process.env["CREEM_API_KEY"] ?? "",
});
async function run() {
const result = await creem.licenses.validate({
key: "<key>",
instanceId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { CreemCore } from "creem/core.js";
import { licensesValidate } from "creem/funcs/licensesValidate.js";
// Use `CreemCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const creem = new CreemCore({
apiKey: process.env["CREEM_API_KEY"] ?? "",
});
async function run() {
const res = await licensesValidate(creem, {
key: "<key>",
instanceId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("licensesValidate failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
components.ValidateLicenseRequestEntity | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.LicenseEntity>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |