1.3.5 • Published 1 year ago

nuxt-newt v1.3.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

nuxt-newt

npm version npm downloads License Nuxt

Newt integration for Nuxt.

Quick Setup

  1. Install the module to your Nuxt application with one command
npx nuxi module add nuxt-newt
  1. Add spaceUid and cdnApiToken to the newt section of nuxt.config.ts
export default defineNuxtConfig({
  modules: ["nuxt-newt"],
  newt: {
    spaceUid: process.env.NEWT_SPACE_UID,
    cdnApiToken: process.env.NEWT_CDN_API_TOKEN,
  },
})
  1. Add your Newt spaceUid and cdnApiToken to the .env file
NEWT_SPACE_UID='YOUR_SPACE_UID'
NEWT_CDN_API_TOKEN='YOUR_CDN_API_TOKEN'

Usage

useNewtGetContents: Get contents

<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>

useNewtGetContent: Get a content

<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>

useNewtGetFirstContent: Get first content

<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>

query details

Contribution

1.3.5

1 year ago

1.3.4

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago