mirror of
https://kevinblog.sytes.net/Code/Jibo-Revival-Group/Zos.git
synced 2026-06-15 15:06:39 +00:00
jibo
Main entry point into the Jibo API.
Installation
Install using NPM.
yarn install jibo --save
Usage
To initialize Jibo and related services, call jibo.init. The first argument to init is the DOM ID of the <div> element that will contain the rendering view for jibo.
index.html
<div id="face"></div>
<script src="main.js"></script>
main.js
const jibo = require ('jibo');
const Status = jibo.bt.Status;
// 'face' is the DOM ID where to add face rendering
jibo.init('face', (err) => {
if (err) {
return console.error(err);
}
// Run a behavior tree and handle the result
jibo.bt.run('./behaviors/main', (status) => {
console.log('Finished with status: %s', status);
});
});