https://www.netlify.com/blog/gatsby-adapters-realize-the-full-potential-of-gatsby-on-your-platform/ You're Invited to Ship **it Securely. A week of feature announcements. Let's Go Close announcement bar Site navigation Go to homepage Skip to content * Search * Log in Toggle main menu * Platform Toggle platform submenu The Netlify Platform Instantly build and deploy your sites to our global network from Git. Custom domains, https, deploy previews, rollbacks and much more. + Explore the Platform + Enterprise Overview + Netlify Connect + Plans & Pricing Key Features + Enterprise Team Management + Edge Functions + Deploy Previews + Forms + Identity + Security + Analytics + Split Testing + Integrations + Changelog Ecosystem + Tech Partners + Agency Partners * Solutions Toggle solutions submenu Why Netlify? + Customers + Case Studies + ROI Calculator + Security at Netlify + Whitepaper Use Cases + Company Websites + E-commerce + Web Apps + Large Sites Don't see your solution? We can help. + Chat with a Netlify expert * Integrations * Start Building Toggle start building submenu Where to start + Docs + Templates + Resources & Guides + Composable Commerce 101 + Work with a Partner Agency Project Kickstarts + Next.js + Jamstack + React + Vue + Svelte + Gatsby + WordPress + Nuxt + Sitecore + + More * Docs * Pricing * Search * Contact * Log in Sign up Close search modal Search Netlify: [ ] Netlify Blog Topics All Posts * All posts * Opinions & Insights * Case Studies * News & Announcements * Guides & Tutorials News & Announcements Gatsby Adapters: Realize the Full Potential of Gatsby on Your Platform News & Announcements Gatsby Adapters: Realize the Full Potential of Gatsby on Your Platform In the beginning, Gatsby was just a Static Site Generation but now it's a Reactive Site Generator that offers features like Deferred Static Generation, Server-Side Rendering, or serverless functions. These additional features require more glue code on deployment platforms and for self-hosting Gatsby. In the past, plugins had to work around missing features or reach into Gatsby's internals. Luckily, these problems are now in the past as today we're happy to introduce Gatsby Adapters! Adapters are responsible for taking the production output from Gatsby and turning it into something your deployment platform understands. We want to make it easier to deploy and host Gatsby on your preferred platform and Gatsby Adapters are a huge step towards that goal. But there's still lots more to do. As our Director of Engineering, Claire Knight, wrote in Taking Gatsby to New Heights: Embracing Adaptability and Openness we want to give you the power of Adapters, enabling seamless integrations between Gatsby and other platforms. Update gatsby to 5.12.0 (e.g. by running npm install gatsby@latest) and you can use and write Gatsby Adapters. Getting started By default, Gatsby will have a manifest of popular adapters it'll reference during a build. This enables zero-configuration deployments on those deployment platforms. For these zero-configuration deployments, no manual user interaction is needed (e.g. no installation/usage of an "auto" package). For example, on Netlify gatsby will automatically install gatsby-adapter-netlify. You can manually install it inside your dependencies if you want to skip the auto-install on each build. The adapter will then set up everything needed to host Gatsby on Netlify. If you want to use an adapter that is not part of Gatsby's manifest, you can install it into your dependencies and add it to your gatsby-config like so: import type { GatsbyConfig } from "gatsby" import adapter from "gatsby-adapter-name" const config: GatsbyConfig = { adapter: adapter(), } export default config As part of the work on Gatsby Adapters, you're now also able to define custom HTTP headers inside gatsby-config: import type { GatsbyConfig } from "gatsby" const config: GatsbyConfig = { headers: [ { source: "/some-path", headers: [ { key: "x-custom-header", value: "hello world" } ] } ] } export default config Gatsby passes all the required information during the build to Adapters to prepare these outputs for deployment on a specific platform. Here are some of the actions an Adapter automatically takes: * Applies HTTP headers to assets * Applies redirects and rewrites. The adapter can also create its own redirects or rewrites if necessary, for example, to map serverless functions to internal URLs. * Wraps serverless functions coming from Gatsby with platform-specific code (if necessary). Gatsby will produce Express-like handlers. * Apply trailing slash behavior and path prefix to URLs * Possibly uploads assets to CDN Learn more Gatsby Adapters are a great addition to the framework and a powerful feature. We have prepared a couple of new documentation pages for you to explain Gatsby Adapters in-depth. Check out these resources: * Adapters Overview: Learn how to find and use adapters * Zero-Configuration Deployments: List of supported deployment platforms and how you can configure their adapters * Creating an Adapter: You can build your own! Start to finish guide on how to create and publish an adapter. * HTTP Headers: As part of the Gatsby Adapters work you can now also specify HTTP headers for a given path Also, check out the source code for gatsby-adapter-netlify and the initial RFC to see what a fully-featured adapter can look like and how the feature came to be. What's next for the Gatsby ecosystem? Gatsby Adapters are just part of our vision for the Gatsby framework to have a great future not just here on Netlify, but also out in the wider world of web development. We have lots more that we're eager to bring to life, some of which are designed to make not just Gatsby, but other frameworks more powerful and efficient here on Netlify. As we balance our work across the Gatsby framework and other parts of its platform and ecosystem and reinforce its future, rest assured that as a vital tool for so many business and organisations, Gatsby's health and prosperity is important to us, and we're excited about it. Profile picture of Marc Littlemore Marc Littlemore Senior Software Engineering Manager Published August 24, 2023 Tags Gatsby Open source changelog --------------------------------------------------------------------- Share Ready to try Netlify? Get started for free --------------------------------------------------------------------- Keep reading Netlify and Gatsby.js logos News & Announcements June 30, 2023 Taking Gatsby to New Heights: Embracing Adaptability and Openness Profile picture of Claire Knight Claire Knight [] Tools & Services June 21, 2022 Cut build times with Gatsby Runner Profile picture of Matt Kane Matt Kane --------------------------------------------------------------------- Recent posts Opinions & Insights Building a world-class cybersecurity program at Netlify Profile picture of Mike Gualtieri Mike Gualtieri August 25, 2023 News & Announcements Netlify Announces the Evolution of Cloud Platform Profile picture of Mathias Biilmann Mathias Biilmann August 24, 2023 News & Announcements How I learned to stop worrying and love the Content Security Policy Profile picture of Jason Barry Jason Barry August 24, 2023 Book cover with the title Deliver web project 10 times faster with Jamstack enterprise Deliver web projects 10x faster Get the whitepaper Go to Netlify homepage Github Youtube Twitter Discourse Why Netlify * Customers * Enterprise * Security * Agency Partner Program * Technology Partner Program Products * Platform * Netlify Build * Netlify Edge * Netlify CLI * Pricing * Changelog * Add-ons + Analytics + Functions + Identity + Forms + Large Media Explore * Docs * Integrations * Jamstack Book * Community * Resources & Guides * Site Speed Test * Remotely Interesting * Technologies + Jamstack + React + Next.js + Vue + Svelte + Gatsby + Nuxt + Sitecore + Drupal + WordPress Company * Blog * About * Careers * Compose Conference * Press * Jamstack Fund * Netlify Store * Sustainability Contact Us * Sales * Support * Status * Forums * Hire an Agency Why Netlify * Customers * Enterprise * Security * Agency Partner Program * Technology Partner Program Products * Platform * Netlify Build * Netlify Edge * Netlify CLI * Pricing * Changelog * Add-ons + Analytics + Functions + Identity + Forms + Large Media Explore * Docs * Integrations * Jamstack Book * Community * Resources & Guides * Site Speed Test * Remotely Interesting * Technologies + Jamstack + React + Next.js + Vue + Svelte + Gatsby + Nuxt + Sitecore + Drupal + WordPress Company * Blog * About * Careers * Compose Conference * Press * Jamstack Fund * Netlify Store * Sustainability Contact Us * Sales * Support * Status * Forums * Hire an Agency Stay up to date with Netlify news Don't fill this out if you're human: [ ] Email address [ ] Please enter a valid email address Subscribe * Trust Center * Privacy * Security * GDPR/CCPA * Abuse (c) 2023 Netlify