2.0.0 • Published 7 years ago
node-storyblok v2.0.0
node-storyblok
Install
npm i node-storyblokUsage
Class Storyblok
Parameters
tokensObject,publicandprivatetoken- (
endpointif using a seperate Storyblok API instance)
Example
const Storyblok = require('node-storyblok');
let sb = new Storyblok({ public: 'public_key_here' });Method Storyblok#getStory
Parameters
[return]Promise, ObjectstoryidString, story-idoptionsObjectversionString, default:Storyblok.MODE_PUBLISHED
Example
let sb = new Storyblok({ public: 'public_key_here' });
sb.getStory('home')
.then((response) => {
response.story;
});Method Storyblok#getStories
Parameters
[return]Promise, ArraystoriesoptionsObjectversionString, default:Storyblok.MODE_PUBLISHED
Example
let sb = new Storyblok({ public: 'public_key_here' });
sb.getStories()
.then((response) => {
response.stories;
});Contribution
Fork me on Github