Skip to content

Instantly share code, notes, and snippets.

@DominikAngerer
Created February 20, 2019 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DominikAngerer/cb009b0b256c534caf34482b26c19037 to your computer and use it in GitHub Desktop.
Save DominikAngerer/cb009b0b256c534caf34482b26c19037 to your computer and use it in GitHub Desktop.
get-all-spaces.js
// 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 start = async () => {
let spacesResponse = await Storyblok.get(`spaces/`, {})
console.log(spacesResponse.data)
}
start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment