Last active
March 20, 2019 19:34
-
-
Save DominikAngerer/9a5c2cc04d42af0066d910deaed2dc30 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// npm install storyblok-js-client | |
const StoryblokClient = require('storyblok-js-client') | |
// Initialize the client with the oauth token so you're | |
// authenticated for the management API | |
const Storyblok = new StoryblokClient({ | |
oauthToken: 'YOUR_OAUTH_TOKEN' | |
}) | |
const spaceId = 'your_space_id' | |
let page = 1 | |
const start = async () => { | |
let storiesResponse = await Storyblok.get(`spaces/${spaceId}/stories`, { | |
per_page: 100, | |
page: page, | |
sort_by:'slug:asc' | |
}) | |
console.log(storiesResponse.data) | |
} | |
start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment