@webthatmatters/ybit-js-sdk
v1.1.4
Published
yBit JS SDK !
Downloads
4
Readme
yBit JS SDK
Installation
npm install @webthatmatters/ybit-js-sdk
Initialization
import Ybit from '@webthatmatters/ybit-js-sdk';
...
getToken = () => {
const promise = new Promise(function(resolve, reject) {
setTimeout(function() {
resolve('INTEGRATION_TOKEN');
}, 300);
});
return promise;
};
...
const yBit = new Ybit(this.getToken);
When in development pass your api URL and ui URL as a second param:
const yBit = new Ybit(this.getToken, {
apiURL: 'http://localhost:3001',
uiURL: 'http://localhost:3002'
})
Render Folders Tree
Create a container element
<div id="ybit-folders" />
and call the yBit foldersSelect function.
yBit.foldersSelect({ container: '#ybit-folders' }, data => {
// This will be called every time a folder is selected
console.log(data);
});