Skip to content

Build event handlers overview

Build event handlers let your extension hook into the Netlify build process of a site that is using your extension. The old way of doing this was through Netlify Build Plugins. Build event handlers operate on a site level.

Build event handlers expand what Netlify builds are capable of. For example, build event handlers allow you to:

  • speed up builds by optimizing and debugging your build cache
  • import and convert data from external sources
  • check for broken links in a site after building
  • analyze and optimize site asset handling for better runtime performance
  • generate content like sitemaps, RSS feeds, and search indexes

Inject functions and edge functions during the build step

You also have the option to create an extension that injects functions and/or edge functions during the build step. Learn more about function injection and edge function injection.

You can use the Netlify SDK commands to run, test, and build your extension as you work.

Once you publish your extension, it will be available for Netlify users to install on their teams.

Documentation

  • Get started: how to generate the boilerplate and add the basic scaffolding for a build event handler in your extension.
  • Hook into build events: overview of Netlify’s build-deploy lifecycle events that a build event handler can hook into.
  • Values & methods: overview of data available to your build event handler, and the utilities and APIs you can use in your code.
  • Debug & test: how to test your build event handler locally on a test site.
  • Migrate Build Plugins: how to migrate an existing build plugin to a build event handler in your extension.

Got it!

Your feedback helps us improve our docs.