The XAPI Class
The xAPI class which manages the communication with the LRS.
Last updated
The xAPI class which manages the communication with the LRS.
To use any of the Resources, you will need to create a new instance of XAPI with credentials.
const endpoint = "https://my-lms.com/endpoint/";
const auth = XAPI.toBasicAuth(username, password);
const xapi = new XAPI({
endpoint: endpoint,
auth: auth
});Parameter
Type
Required
Description
endpoint
string
true
The URL of the endpoint.
auth
string
false
The Authorization header value to be appended to all requests. Defaults to Basic 0g==, which is equivalent of Basic followed by a base64 encoded version of the string :.
adapter
false
The underlying adapter to make HTTP requests with. Accepts axios, fetch or a custom adapter function. Defaults to axios.
This returns an XAPI object which you can use to communicate with the LRS.
Last updated