Skip to content

xh4zr/sei-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sei-node

A Caveon SEI helper library

Most functions are async and return a promise

Install

npm install sei-sdk

Include the library

var sei = require('./sei-node/');

Create the client

Option 1

var clientToken = sei.createClientWithIntegration({ token: <INTEGRATION_TOKEN>, examId: <SEI_EXAM_ID> });
clientToken.exam.get({ include: 'settings' }).then(function (exam) {
    console.log('exam', exam);
}, function (err) {
    console.log(err);
});

Option 2

sei.createClient({ username: <SEI_ID>, password: <SEI_SECRET>, examId: <SEI_EXAM_ID> }).then(function (client) {
    return client.exam.get({ include: 'settings' });
}).then(function (exam) {
    console.log('exam', exam);
}, function (err) {
    console.log(err);
});

Option 3

DON'T CHOOSE THIS OPTION IT WILL BE REMOVED

var clientBasic = sei.createClientWithBasicAuth({ username: <SEI_ID>, password: <SEI_SECRET>, examId: <SEI_EXAM_ID>, roleSecret: <SEI_ROLE_SECRET> });
clientBasic.exam.get({ include: 'settings' }).then(function (exam) {
    console.log('exam', exam);
}, function (err) {
    console.log(err);
});

Make any request

var examRequest = {
    method: 'GET',
    url: '/exams/' + <SEI_EXAM_ID>
};
// include optional headers

clientToken.makeRequest(examRequest).then(function (exam) {
    console.log('made request');
    console.log(exam);
});

About

A Caveon SEI helper library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published