Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. // npm install storyblok-js-client
  2. const StoryblokClient = require('storyblok-js-client')
  3.  
  4. // Initialize the client with the oauth token so you're
  5. // authenticated for the management API
  6. const Storyblok = new StoryblokClient({
  7. oauthToken: 'YOUR_OAUTH_TOKEN'
  8. })
  9. const spaceId = 'your_space_id'
  10. let page = 1
  11.  
  12. const start = async () => {
  13.  
  14. let storiesResponse = await Storyblok.get(`spaces/${spaceId}/stories`, {
  15. per_page: 100,
  16. page: page,
  17. sort_by:'slug:asc'
  18. })
  19. console.log(storiesResponse.data)
  20. }
  21.  
  22. start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement