Using a Plugin in Your Site

Gatsby plugins are Node.js packages, so you can install them like other packages in node using npm.

For example, gatsby-transformer-json is a package that adds support for JSON files to the Gatsby data layer.

To install it, in the root of your site you run:

Then in your site’s gatsby-config.js you add gatsby-transformer-json to the plugins array like:

Plugins can take options. For example:

Note that plugin options will be stringified by Gatsby, so they cannot be functions.

Edit this page on GitHub