storyblok / storyblok-nuxt-2

6 stars 8 forks source link

Is there a recommended way of handling obfuscating/hiding storyblok calls? #103

Closed SebbeJohansson closed 1 year ago

SebbeJohansson commented 1 year ago

We would like to hide the requests to storyblok so that they are not shown on the client, but instead done in a server location. Is there a recommended way of doing that?

Currently we are doing all the fetching from storyblok straight in a plugin and/or in a page template. We want to put the fetching on the server side so that users: 1) Dont see our tokens and/or the requests. 2) That they are fully fetched on the server. 3) More easily cached etc.

Is there a recommended way of doing this?

SebbeJohansson commented 1 year ago

Future Seb to the rescue!

For anyone who might find this, the way I suggest you do this is either with an API middleware within nuxt (nuxt3 example here) or as a proxy outside of nuxt.