Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 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()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement