Overview
The Nuxt Directus is a tool that provides a software development kit (SDK) for integrating the Directus API with Nuxt.js applications. It offers support for server-side rendering, a REST client, a GraphQL client, and an authentication handler. The module can be easily installed and configured in Nuxt.js projects.
Features
- SSR Support: The Nuxt Directus module provides support for server-side rendering in Nuxt.js applications.
- Rest Client: It includes a REST client via the useDirectusRest composable, which is based on the new Directus SDK.
- GraphQL Client: The module also offers a GraphQL client based on the Nuxt Apollo module for data fetching.
- Auth Handler: It provides an authentication handler via the useDirectusAuth composable, which includes features like auto-refresh of access token and auto-redirection.
Installation
To install the Nuxt Directus module, you need to add the “@bg-dev/nuxt-directus” dependency to your project. Then, add “@bg-dev/nuxt-directus” to the modules section of the “nuxt.config.ts” file and configure the Directus options. After that, you can use the module in your Nuxt app.
Summary
The Nuxt Directus module is a useful tool for integrating the Directus API with Nuxt.js applications. It offers features like server-side rendering support, a REST client, a GraphQL client, and an authentication handler. The module can be easily installed and configured in Nuxt.js projects, making it a convenient choice for developers working with Directus and Nuxt.js.