Setup

Connect to Directus easily from Nuxt with following commands ✨


Installation

  1. Add nuxt-directus dependency to your project:
npx nuxi@latest module add directus
  1. Add it to your modules section in your nuxt.config:
export default defineNuxtConfig({  modules: ['nuxt-directus']})
  1. Configure your Directus Server in the nuxt.config:
export default defineNuxtConfig({  modules: ['nuxt-directus'],  runtimeConfig: {    public: {      directus: {        url: ""      }    }  }})

Options

You can customize the module's behavior by using the directus property in nuxt.config:

nuxt.config
export default {  runtimeConfig: {    directus: {      // Options    }  }}

See the module options.

Table of Contents