@libretexts/cxone-expert-node

1.0.0 • Public • Published

CXone Expert Node SDK

This package is a custom SDK developed by LibreTexts to interact with the CXone Expert API. It should be noted that this package is NOT developed or maintained by CXone and, as such, does not guarantee 100% compatibility with the latest API updates.

Install

npm install @libretexts/cxone-expert-node

Usage

import Expert from "@libretexts/cxone-expert-node";

const tld = "mysite.example.com"; // Your CXone site domain

const expert = new Expert(tld);

// Authenticate using server credentials
const authInstance = await expert.auth.ServerToken({
  key: "mykey",
  secret: "mysecret",
  user: "myuser",
});

// Or, use auth.BrowserToken() to use a CXone provided JWT (not intended for production use)

// Get authentication header(s) (X-Deki-Token)
const authHeaders = authInstance.getHeader();

// Use the appropriate module(s) to interact with your site's API
const page = await expert.pages.getPage(123, {
  auth: authHeaders,
  tld,
});

console.log(page);

License

This package is open-source and free to use under the MIT License.

Readme

Keywords

none

Package Sidebar

Install

npm i @libretexts/cxone-expert-node

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

18.3 kB

Total Files

16

Last publish

Collaborators

  • libretexts