Collection of Tools to deals with the Volume API
yarn add volumesdk
import VolumeSDK from 'volumesdk';
const url = 'https://myapi.volumenetwork.com';
const email = 'bilbo.baggins@theshire.com';
const password = 'myPrecious';
const vsdk = new VolumeSDK({
url,
});
vsdk.authenticate(email, password)
.then(() => {
vsdk.fetchChannels()
.then((result) => {
console.log(result);
});
});
import VolumeSDK from 'volumesdk';
const url = 'https://myapi.volumenetwork.com';
const email = 'bilbo.baggins@theshire.com';
const password = 'myPrecious';
const vsdk = new VolumeSDK({
url,
});
vsdk.authenticate(email, password)
.then((userinfo) => {
console.log(userinfo);
});
import VolumeSDK from 'volumesdk';
const url = 'https://myapi.volumenetwork.com';
const email = 'bilbo.baggins@theshire.com';
const password = 'myPrecious';
const vsdk = new VolumeSDK({
url,
});
vsdk.sessionIsActive()
.then((result) => {
console.log(result); // true / false
});
N.B. Must have authenticated first.
vsdk.fetchChannels()
.then((channels) => {
console.log(channels);
});
import Channel from 'volumesdk/dist/channel';
const url = 'https://myapi.volumenetwork.com';
const email = 'bilbo.baggins@theshire.com';
const password = 'myPrecious';
const c = new Channel({
url,
});
c.authenticate(email, password)
.then(() => c.fetchAll()
.then((result) => {
console.log(result);
}));
import Storyboard from 'volumesdk/dist/medias';
const url = 'https://myapi.volumenetwork.com';
const email = 'bilbo.baggins@theshire.com';
const password = 'myPrecious';
const m = new Media({
url,
});
m.authenticate(email, password)
.then(() => s.fetchAll()
.then((result) => {
console.log(result);
}));
import Storyboard from 'volumesdk/dist/storyboard';
const url = 'https://myapi.volumenetwork.com';
const email = 'bilbo.baggins@theshire.com';
const password = 'myPrecious';
const s = new Storyboard({
url,
});
s.authenticate(email, password)
.then(() => s.fetchAll()
.then((result) => {
console.log(result);
}));
import Storyboard from 'volumesdk/dist/storyboard';
const url = 'https://myapi.volumenetwork.com';
const email = 'bilbo.baggins@theshire.com';
const password = 'myPrecious';
const id = 1;
const s = new Storyboard({
url,
});
s.authenticate(email, password)
.then(() => s.fetch(id)
.then((result) => {
console.log(result);
}));
import Storyboard from 'volumesdk/dist/storyboard';
const url = 'https://myapi.volumenetwork.com';
const email = 'bilbo.baggins@theshire.com';
const password = 'myPrecious';
const id = 1;
const s = new Storyboard({
url,
});
s.authenticate(email, password)
.then(() => s.save({
id: 3, // if no id is set, will create new storyboard
storyboard: {
foo: 'bar',
items: [{}, {}],
},
})
.then((result) => {
console.log(result);
}));