1.1.4 • Published 5 years ago

@webthatmatters/ybit-js-sdk v1.1.4

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
5 years ago

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);
});
1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago