NuxtN
Nuxtβ€’2y agoβ€’
4 replies
dosyourself

Prevent developers from using secrets in client-side code

I've read up on server only components/etc, but it's not immediately clear to me if there is a way to prevent developers from accidentally using server code in the client. Is there anything that Nuxt does to prevent this similar to what SvelteKit does here https://kit.svelte.dev/docs/server-only-modules#how-it-works ? Basically, just want to disallow importing or invoking functions from the server directory in the client outside of fetching the endpoint.
Server-only modules β€’ SvelteKit documentation
SvelteKit docs
Was this page helpful?