· 6 years ago · Feb 23, 2019, 09:32 AM
1// npm install storyblok-js-client
2const StoryblokClient = require('storyblok-js-client')
3
4// Initialize the client with the oauth token so you're
5// authenticated for the management API
6const Storyblok = new StoryblokClient({
7 oauthToken: 'YOUR_OAUTH_TOKEN'
8})
9
10const start = async () => {
11
12 let spacesResponse = await Storyblok.get(`spaces/`, {})
13 console.log(spacesResponse.data)
14
15}
16
17start()