Baasic JavaScript library provides integration access to Baasic REST API core end-points.
Baasic JavaScript library has the following dependencies:
This section will describe how to add the Baasic JavaScript library to your project. It's important to know that Baasic JavaScript SDK uses JSON format by default and it be setup to use HAL+JSON format for the back-end communication. You can find out more about HAL format here.
Please add the following lines of code after the jQuery include:
<script src='https://code.jquery.com/jquery-3.1.1.slim.min.js'></script>
<script src='/js/hal-parser.js'></script>
<script src='/js/uritemplate-min.js'></script>
<script src='/js/baasic-sdk-javascript-2.0.0.min.js'></script>
To create the BaasicApp you will need to use the baasicSdkJavaScript object on the global scope.
//Note: this is configuration example only, these are the defaults
var options = {
apiRootUrl: 'api.baasic.com',
apiVersion: '<version>',
enableHALJSON: false
};
var application = new baasicSdkJavaScript.BaasicApp('<api-key>', options);
application.membershipModule.login.login({
username: '<username>',
password: '<password>'
}).then(function (data) {
//Do your work here
}, function (data) {
console.log(data);
});
Baasic back-end contains various built-in modules that can be easily consumed through the Baasic JavaScript library. Baasic Developer Center contains detailed information about all the core modules supported by the JavaScript library.
npm install
Baasic JavaScript library has the following developer dependencies:
We appreciate pull requests you make, and we'll do our best to process them as quickly as we can. Even if it's just a typo you found or any small or large issue you fixed - please do it! It will help us a lot.
If your pull request is not accepted on your first try, don't be discouraged! If there's a problem with your implementation, hopefully you received feedback on what to improve.
Before you create a new issue, please make sure it hasn't already been reported. In case it already exists simply add a quick "+1" or "I have the same problem" to the existing issue thread.
Generated using TypeDoc