Skip to content

Instantly share code, notes, and snippets.

@DominikAngerer
Last active March 20, 2019 19:34
Show Gist options
  • Save DominikAngerer/9a5c2cc04d42af0066d910deaed2dc30 to your computer and use it in GitHub Desktop.
Save DominikAngerer/9a5c2cc04d42af0066d910deaed2dc30 to your computer and use it in GitHub Desktop.
// 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