
Source plugin for pulling data into Gatsby from a Directus API.
The gatsby-source-directus is a source plugin that allows users to pull data from a Directus API into the Gatsby GraphQL Data Layer. It provides a convenient way to access and query data from a Directus instance within a Gatsby project.
npm install gatsby-source-directus@4
npm install gatsby-source-directus@5
Add the package to your gatsby-config.js file in your Gatsby project:
module.exports = {
plugins: [
{
resolve: "gatsby-source-directus",
options: {
url: "https://your-directus-api-url.com",
// other configuration options
},
},
],
};
The gatsby-source-directus plugin is a useful tool for integrating Directus API data into a Gatsby project. With its support for both gatsby@4 and gatsby@5 versions, authentication options, customizable GraphQL type and field names, and development environment configurations, it provides flexibility and convenience for developers working with Gatsby and Directus.

GatsbyJS is a free and open-source static site generator based on React. It uses a modern development stack including Webpack, GraphQL, and modern JavaScript and CSS frameworks. It also provides a rich set of plugins, starters, and themes.
A website that uses Directus as an open source headless CMS to manage content. This includes features such as a customizable content model, role-based access control, and API-based content delivery to support a wide range of digital experiences.
Recoil is a state management library for React that provides an intuitive and flexible API for managing and sharing state across components. It supports a range of features, including derived state, asynchronous updates, and time-travel debugging, and is designed to work well with the React ecosystem and other state management solutions.