#Initial Integration of Storyblok

1 messages · Page 1 of 1 (latest)

jovial leaf
#

Hi all (: Would anybody be able to help me out with the initial configurations of Storyblok? I've been trying to get things to work for the past 3 hours, but I keep receiving different errors and don't really understand which tutorial to follow, or which docs would be most relevant.

tulip turret
#

Hey @jovial leaf what material are you using bud,

#

Ill see if I can help out

jovial leaf
#
  1. This is the first one I've followed: https://www.storyblok.com/mp/announcing-storyblok-astro
  2. 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
  3. I also checked out this repo https://github.com/storyblok/storyblok-astro
  4. 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

tulip turret
#

ah

#

is this what you are referring to?

jovial leaf
#

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

tulip turret
#

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

jovial leaf
jovial leaf
tulip turret
#

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

jovial leaf
#

Ohh okay gotcha, I was a bit confused because the first link didn't have this, nor does the stackblitz(?)

tulip turret
#

aye that would be misleading,

jovial leaf
#

Not sure why, but this happens whenever I try to run the server:

#

Which started happening at this point in the tutorial:

wraith palm
#

thank your for opening this thread @jovial leaf

jovial leaf
wraith palm
#

I am not sure what exactly went wrong. lets recap a bit did you set up you environment variables?

jovial leaf
wraith palm
#

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

jovial leaf
#

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.

wraith palm
#

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

jovial leaf
#

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

wraith palm
#

are you using the astro integration or just the SDK?

jovial leaf
#

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.

wraith palm
#

did you install it?

jovial leaf
#

Oh yes

#

I also installed storyblok/js

jovial leaf
wraith palm
#

we can try either which one do you prefer?

jovial leaf
#

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.

wraith palm
#

yeah np

#

lets move this to chat

wraith palm
#

How is it going?

scarlet ridge
# wraith palm yeah np

I'm also trying to make astro work with storyblok, keep getting errors, do we have newly updated tutorial?

wraith palm
scarlet ridge