#Initial Integration of Storyblok
1 messages · Page 1 of 1 (latest)
- This is the first one I've followed: https://www.storyblok.com/mp/announcing-storyblok-astro
- I couldn't figure out the first one so I found this: https://www.storyblok.com/tp/add-a-headless-cms-to-astro-in-5-minutes#connecting-astro-to-storyblok
- I also checked out this repo https://github.com/storyblok/storyblok-astro
- https://stackblitz.com/edit/astro-sdk-demo?file=src%2Fpages%2F[slug].astro I've been trying to understand this stackblitz which is referred to in the first article, but I'm confused haha
The second article goes into creating a storyblok.js file which I don't see in the first article, or the repo link
Yes
I've just gone ahead and created a new astro project so that I can start from scratch and try to implement storyblok into this one haha
so this file you have to makeup yourself in the src/utils/storyblok.js
this file you can copy pretty much 1:1 into your project
do keep me posted @jovial leaf
For sure I appreciate it!
So this file is required right?
yup, in this file we are initiating storyblok on line 11, passing in some variables we get from the environment, we are then exporting a couple of specialised functions to help get the data back from storyblock that we use elsewhere within our astro project,
so If you wanted to add some more methods and functionality to Storyblok this is where you would go to add to
Ohh okay gotcha, I was a bit confused because the first link didn't have this, nor does the stackblitz(?)
aye that would be misleading,
Not sure why, but this happens whenever I try to run the server:
Which started happening at this point in the tutorial:
https://www.storyblok.com/tp/add-a-headless-cms-to-astro-in-5-minutes#creating-a-base-layout-and-an-index-page - I tried copying the section link, but they don't seem to have it configured properly
thank your for opening this thread @jovial leaf
Yeah no problem! Do you know what could be wrong?
I am not sure what exactly went wrong. lets recap a bit did you set up you environment variables?
Yes, I copied and pasted it as it was in the tutorial. But I saw in the Astro docs that env variables were being prefixed with PUBLIC which I also tried
I also followed this tutorial to allow my localhost to work on storyblok https://www.storyblok.com/faq/setup-dev-server-https-proxy
since you are working inside the --- (fence) it doesn't need a public prefix
but yeah if you have all the env variables we should be all set with it
So in the tutorial there is this step that says to enable Real Time Visual Editing Experience
I've never used Storyblok before, so I can't tell if this is covered in the tutorial, or if I actually need to go to that link and follow those steps.
oh I see. Since we are fetching data in dev mode it should contain all updated data
for production you may need to add a webhook to rebuild your side if static.
I am sorry I didn't mean to overwhelm you with all this information. I am writing a cms tutorial and your input is perfect on what sections need to be expanded more
Oh no problem! I'm just trying to follow that tutorial, but I keep encountering that error. I kept running into it on my actual project. I created a new project to start from scratch but I'm running into it again
are you using the astro integration or just the SDK?
I tried using the astro integration first but had no luck with it. I think I'm still using the integration?
Honestly I don't know which is which.
the astro integration is this link https://www.storyblok.com/mp/announcing-storyblok-astro
did you install it?
This was the very first tutorial I tried following, but could not get it to work
we can try either which one do you prefer?
Let's go with the official integration if possible
Also, if it would be simpler for you to go on a voice channel and I can share my screen or something I can do that as well.
How is it going?
I'm also trying to make astro work with storyblok, keep getting errors, do we have newly updated tutorial?
Hello 👋, the tutorial is fairly new maybe something got updated and we need to revisit or document some edge cases. What error have you been running into?
once I added storyblok/astro, i got this error, and I revert everything, this error still exist, https://discordapp.com/channels/830184174198718474/1042021815544991765