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.
npm install @libretexts/cxone-expert-node
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);
This package is open-source and free to use under the MIT License.