Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 1.19 KB

README.md

File metadata and controls

40 lines (29 loc) · 1.19 KB

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.