What is a plugin?
Gatsby’s plugin layer includes a wide variety of common website functionality that you can drop in to your website. There are many types of Gatsby plugins, including:
Integrations, or “source plugins”. These plugins pull data into Gatsby’s GraphQL layer and make it available to query from your React components. Gatsby has source plugins for a wide range of headless CMSs, databases and spreadsheets, as well as the local filesystem. Here is a guide on sourcing data.
Dropping in analytics libraries like Google Analytics, Google Tag Manager, Segment, Hotjar, and others.
Performance enhancements while using CSS libraries, like Sass, styled-components and emotion. These plugins are not required to use these libraries but do make it easier and faster for the browser to parse styles.
Other website functionality, like SEO, offline support, sitemaps, and RSS feeds.
One point of confusion people sometimes have is “when don’t I need a plugin?” The answer is “most things”! As a general rule, any npm package you might use while working on another JavaScript or React application can also be used with a Gatsby application. Even when plugins are helpful, they are always optional.
Feel free to browse and search plugins at Gatsby’s Plugin Library or read the documentation on how to add a plugin.
Advanced use-cases include making your own plugins and either distribute them for fellow Gatsby developers to use or install them locally.