Using a Gatsby Plugin

Share this video with your friends

Send Tweet

A Gatsby plugin is a Node package that uses the Gatsby APIs under the hood.

You can use a plugin to source data into your site, transform content or enhance the output of your site like adding google analytics etc...

Gatsby plugins can be categorized into 3 types:

  • A Gatsby Source plugin (e.g: gatsby-source-contentful pulls data from Contentful)
  • A Gatsby Transformer Plugin (e.g: gatsby-transformer-remark convert markdown text to html)
  • A Gatsby Plugin (e.g: gatsby-plugin-google-analytics adds Google analytics in your site)

How to install and configure a plugin

  1. Install a plugin you can run the command npm install plugin-name e.g npm install gatsby-plugin-postcss.

  2. Add the plugin to your gatsby-config.js file

In this lesson, you learn how to use gatsby-plugin-postcss to add tailwindcss support to your project