Needs advice
on
Nuxt.jsNuxt.js
and
GridsomeGridsome

Hello All,

I would like some advice on what you would suggest for a website showing products & services. Max, about 100 products. No eCommerce features are required at the moment. I will also add a search feature and a couple of forms.

I already use Storyblok CMS for the content side of things. One thing that worries me about choosing the build is I ideally don't want the public API key visible, just to prevent any future abuse. I understand if I use the build module in Nuxt.js for storybook, the API key is visible in $nuxt in the console.

READ LESS
3 upvotes8.5K views
Replies (5)
Avatar of levimichael
Lead Engineer, Developer Relations & Merchant Strategy at Nacelle
Recommends
VercelVercelNuxt.jsNuxt.js

Hey Andrew,

This is a common question I鈥檝e dealt with a lot. I鈥檝e been using Nuxt professionally for over 3 years now, and one solution is to proxy your StoryBlok requests with another api endpoint, that way you only expose the data you want while protecting any other data you鈥檙e worried about. You can do this really easily using Vercel Serverless functions. Furthermore, using the Nuxt generate command, you can statically render your content at build time so your users won鈥檛 even hit an api at all when they are using your site!

READ MORE
4 upvotes1 comment6.2K views
Andrew B
Andrew B
January 13th 2021 at 7:37AM

Thanks for the repsonse Levi.

Yeah i think that is the route i will take by doing proxy requests and using Nuxt. I'll have to check out Vercel, but i have used netlify serverless functions before.

Thanks again.

Reply
Recommends
Nuxt.jsNuxt.jsGridsomeGridsome

If you don't want to expose your API then just go static. Both Nuxt and Gridsome have the ability to generate static pages.

READ MORE
3 upvotes2 comments4.6K views
Levi Whalen
Levi Whalen
January 13th 2021 at 5:55AM

馃憣馃憣

Reply
Andrew B
Andrew B
January 13th 2021 at 7:43AM

thanks for the response Luis.

I will go down the track Levi has mentioned by proxying the calls to storyblok with axios.

In nuxt, If i use the build module for the api, even on static generation the endpoint and token will still be visible in the $nuxt object for that module.

Reply
View all (5)
Avatar of Andrew B