Thanks to the 'callOnce' utility in Nuxt, you can execute a specified function or block of code once during server-side rendering (SSR) or client-side rendering (CSR).
<script setup lang="ts">
const websiteConfig = useState('config')
await callOnce(async () => {
console.log('This will only be logged once')
websiteConfig.value = await $fetch('https://my-cms.com/api/website-config')
})
</script>