Getting Started
How to get the library up and running in your project.
UMD (Browser, client-side applications)
<script src="https://unpkg.com/@xapi/xapi"></script>
<script type="text/javascript">
// Create LRS connection
const endpoint = "https://my-lms.com/endpoint";
const username = "username";
const password = "password";
const auth = XAPI.toBasicAuth(username, password);
const xapi = new XAPI({
endpoint: endpoint,
auth: auth
});
// Create your statement
const myStatement = { ... };
// Send your statement
xapi.sendStatement({
statement: myStatement
});
</script>ES Module (Browser, client-side applications)
CJS (Server-side applications)
Last updated