with @storyblok/nuxt, unpublished pages are publicly accessible

With the given approach in its readme file, all the unpublished pages are publicly accessible, which is very insecure.

const story = await useStoryblok("vue", { version: "draft" });

Is it possible to apply version: "published" if not accessed from Storyblok editor?
Please advise!

Hello @mitsuki,

there are different ways of handling that. You could for example use an environment variable. In that way, you can set , for example, a STORYBLOK_CONTENT_VERSION variable with the value draft or published (depending on the environment), and then you can use it in your API calls like this:

useStoryblok("home", { version: process.env.STORYBLOK_CONTENT_VERSION })

or you use the technique mentioned here How to use storyblok-latest.js - Storyblok

In case you have more implementation-related questions feel free to get in touch with our developer community on Discord: Storyblok

Best regards