@baobabtech/talentlms-js
v0.0.15
Published
A TypeScript/JavaScript wrapper for the TalentLMS API
Downloads
4
Maintainers
Readme
TalentLMS API Wrapper
A TypeScript/JavaScript wrapper for the TalentLMS API, making it easy to interact with TalentLMS from your Node.js applications.
Important Note: This wrapper is for https://www.talentlms.com/ We have no affiliation with TalentLMS; we built this TypeScript version to help us support our clients. For any questions about the TalentLMS API, please check their support resources.
Installation
npm install talentlms-js
Usage
Configure the TalentLms API wrapper with your API key and domain:
import TalentLms from 'talentlms-js';
const talentlms = new TalentLms({
apiKey: 'your_api_key', // as provided by TalentLMS
subdomain: 'your_subdomain', // the subdomain part of your TalentLMS instance e.g. if your instance is at https://company.talentlms.com, then your subdomain is "company"
// alternatively you can pass in the entire domain as a string e.g. "https://company.talentlms.com"
domain: 'company.talentlms.com'
});
async function example() {
const users = await api.getAllUsers();
console.log(users);
const course = await api.getCourseByCode('COURSE001');
console.log(course);
const usersByPhone = await api.getUserByPhone('1234567890');
console.log(usersByPhone);
}
example().catch(console.error);