export default defineNuxtConfig({
modules: ["nuxt-newt"],
newt: {
spaceUid: process.env.NEWT_SPACE_UID,
cdnApiToken: process.env.NEWT_CDN_API_TOKEN,
},
})
<script setup lang="ts">
const { data } = await useNewtGetContents<T>(key, {
appUid: 'YOUR_APP_UID',
modelUid: 'YOUR_MODEL_UID',
query: {
// Add your query here (optional)
},
});
</script>
<script lang='ts' setup>
const { data } = await useNewtGetContent<T>(key, {
appUid: 'YOUR_APP_UID',
modelUid: 'YOUR_MODEL_UID',
contentId: 'YOUR_CONTENT_ID',
query: {
// Add your query here (optional)
},
});
</script>
<script lang='ts' setup>
const { data } = await useNewtGetFirstContent<T>(key, {
appUid: 'YOUR_APP_UID',
modelUid: 'YOUR_MODEL_UID',
query: {
// Add your query here (optional)
},
});
</script>