Storyblok Tutorial #2: Using Storyblok JS Client

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in the previous video we used the native javascript fetch function today we're gonna switch from that to the official storyblock javascript client which is the official javascript sdk for the storyblock api we highly recommend using it because it handles the rate limits of the storyblock api calls and it's just better for more complex data fetches to use it we need to install the storyblock.js client and we're going to import it to our code once that's done we can create an instance with the connection to storyblock which requires a parameter of an access token which we have from our url so we're going to copy that and now we can start refactoring our code so we're going to call the get function from storyblock where we define this log or the story that we want to fetch from our storyblock backend and as a second parameter which is an object we're gonna define the version as draft because we don't want the published data only the draft to be fetched so let's temporarily hide the data that we had rendered and just have a preview of the data so we can see that it works and we can see that the data is fetched now we're going to do a similar then response that we did in the last video that means that we only need the story property of our fetch data more specifically only the content part of our story property and now as i uncomment the parts i can see that my page is rendered as it was before
Info
Channel: LIFTED
Views: 1,042
Rating: undefined out of 5
Keywords: cms, headless, storyblok, tutorial, quick, introduction, javascript, js, learning, dev, development, fetching, client
Id: A_DuPV5KkYU
Channel Id: undefined
Length: 1min 52sec (112 seconds)
Published: Thu Mar 11 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.