Kuzzle
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
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('people')
.createDocument(myDoc, function(error, response) {
if (error) {
}
});
Hate callbacks & love promises ?
There are promise-based methods for all Kuzzle method allowing a callback. Just suffix those methods with Promise
.
Here is the above example, using promises:
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('people')
.createDocumentPromise(myDoc)
.then(response => {
})
.catch(error => {
});
});
HTML
Vanilla
Download the file kuzzle.min.js available in the browser branch of this project.
<script type="text/javascript" src="path/to/kuzzle.min.js"></script>
You are now ready to use Kuzzle:
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('people')
.createDocument(myDoc, function(error, response) {
if (error) {
}
});
License
Apache 2