https://github.com/cryptlex/web-api-client-js
https://github.com/cryptlex/web-api-client-js
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cryptlex/web-api-client-js
- Owner: cryptlex
- Created: 2022-11-21T09:52:01.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-01T23:22:49.000Z (over 2 years ago)
- Last Synced: 2025-10-24T21:58:54.376Z (8 months ago)
- Language: TypeScript
- Size: 660 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# @cryptlex/web-api-client
[](https://www.npmjs.com/package/@cryptlex/web-api-client) 
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.
```ts
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](https://github.com/cryptlex/web-api-client-js/blob/main/docs/functions.md) available.