Official Kuzzle Javascript SDK
This SDK version is compatible with Kuzzle 1.0.0-beta.1 and higher
About Kuzzle
For UI and linked objects developers, Kuzzle is an open-source solution that handles all the data management (CRUD, real-time storage, search, high-level features, etc).
You can access the Kuzzle repository on Github
SDK Documentation
The complete SDK documentation is available here
Installation
This SDK can be used either in NodeJS or in a browser.
NodeJS
npm install kuzzle-sdk --save
Basic usage
var
Kuzzle = require('kuzzle-sdk'),
kuzzle = new Kuzzle('http://foobar:7512');
var myDoc = {
name: 'Rick Astley',
birthDate: '1966/02/06',
mainActivity: 'Singer',
website: 'http://www.rickastley.co.uk',
comment: 'Never gonna give you up, never gonna let you down'
};
kuzzle
.dataCollectionFactory('music', 'people')
.createDocument(myDoc, function(error, response) {
if (error) {
}
});
kuzzle
.dataCollectionFactory('music', 'people')
.createDocumentPromise(myDoc)
.then(response => {
})
.catch(error => {
});
});
Javascript
You can install this SDK with Bower.
bower install kuzzle-sdk --save
<script type="text/javascript" src="bower_components/socket.io-client/socket.io.js"></script>
<script type="text/javascript" src="bower_components/kuzzle-sdk/dist/kuzzle.min.js"></script>
Basic usage
var
kuzzle = new Kuzzle('http://foobar:7512');
var myDoc = {
name: 'Rick Astley',
birthDate: '1966/02/06',
mainActivity: 'Singer',
website: 'http://www.rickastley.co.uk',
comment: 'Never gonna give you up, never gonna let you down'
};
kuzzle
.dataCollectionFactory('music', 'people')
.createDocument(myDoc, function(error, response) {
if (error) {
}
});
Building manually
Clone this github repository and run grunt
. A dist
directory will be created, containing a plain browserified version of this SDK, and a minified version.
License
Apache 2