eva-sdk-js
v4.8.5
Published
The JavaScript based SDK for the EVA platform
Downloads
75
Readme
About the EVA JavaScript SDK
DEPRECATION NOTICE: This SDK is deprecated. Please check out the current EVA SDK
The EVA SDK provides access to the functionality exposed by the EVA API using developer focused methods and classes. It is tightly coupled to the low-level shared definitions exposed by the EVA API. The SDK provides a higher level of abstraction for using the EVA API.
Installing
The SDK is available through both npm:
npm install --save eva-sdk-js
and bower:
bower install --save eva-sdk-js
Basic usage
The SDK needs to be initialised once before it can be used.
var EvaSDK = require( "eva-sdk-js" );
var applicationId = 1;
var endPointURL = "https://eva.newblack.io";
var authenticationToken = "YOURTOKENHERE";
EvaSDK.init( authenticationToken, applicationId, endPointURL );
Once initialised you can start using the classes exposed by the SDK to gain access to data in EVA. As an example the below code retrieves a product from the server.
var product = new EvaSDK.Product( productId );
product.fetch()
.then( function( response )
{
// Product data is available in the response variable or
// from the product.data property or product.getData() method
//
console.log( "Product data", response );
} )
.catch( function( error )
{
console.error( "Product retrieval error", error );
} );
You can check the documentation or unit tests for more examples
Developing
Dependencies are installed with npm install
and bower install
This SDK uses gulp for its development task. You can run gulp
to get a list of available commands and a description of what the task does.
Building the SDK bundle is done with gulp build
.
You may need to update the EVA shared definitions files at times.
You can run gulp typings
to automatically download and install them.
During development you can let gulp watch for file changes and rebuild your bundle using gulp watch
.
Releasing
Builds from master branch of the SDK are automatically published to NPM. Versioning is managed by semantic release. The master branch is locked for direct commits. Changed should be collected on develop and once a release is required a pull request on github needs to be made from develop to master. This pull request will be validated using TravisCI before it can be merged for the actual release build.
Documentation
The SDK is documented using typedoc. Once you can successfully build the SDK you can generate it using gulp typedoc
.
The documentation can be found in the docs/ folder.
Testing
You can run the unit tests with gulp test
If you want to run a specific unit test you can specify you can do:
gulp test --tests=test/products-spec.js
You can run the tests without building like so:
gulp test --skip-build --tests=test/products-spec.js