@cryptlex/web-api-client
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

@cryptlex/web-api-client

latest-npm-version build

The Cryptlex Web API Client library provides access to the Cryptlex Web API from applications written in JavaScript. The library maintains types for supporting TypeScript(=>3.5).

Requirements

Node 14 or higher

Installation

npm install @cryptlex/web-api-client

Usage

The library needs to be configured with the a valid access token. This is done in the CryptlexWebApiClientOptions instantiation.

import { CryptlexWebApiClient, CryptlexWebApiClientOptions } from "@cryptlex/web-api-client";

const ACCESS_TOKEN = "**ACCESS_TOKEN**";
const PRODUCT_ID = "**PRODUCT_ID**";

const clientOptions = new CryptlexWebApiClientOptions(ACCESS_TOKEN);
const client = new CryptlexWebApiClient(clientOptions);

try {
  // Create a license in the product defined by PRODUCT_ID
  const licenseResponse = await client.createLicense({ productId: PRODUCT_ID });
  console.log("Successfully created license: " + JSON.stringify(licenseResponse.data));
} catch (error) {
  console.error(error);
}

Functions

The extent of this library can be seen in the complete list of functions available.

Readme

Keywords

Package Sidebar

Install

npm i @cryptlex/web-api-client

Weekly Downloads

0

Version

1.2.1

License

ISC

Unpacked Size

99.3 kB

Total Files

52

Last publish

Collaborators

  • adnan.kamili