Netlify plugin

The build step, packaged as a Netlify Build Plugin. It runs after your build on the publish directory, using your site's Netlify URL.

npm i -D netlify-plugin-headlark
# netlify.toml
[[plugins]]
package = "netlify-plugin-headlark"

  # optional: fail the build if a page can't be optimized
  [plugins.inputs]
  strict = true

Add HEADLARK_KEY (your site's secret key) under Site configuration → Environment variables. Its scopes must include Builds; a variable scoped only to Functions or Runtime is invisible to the plugin.

What it does

The plugin is on npm as netlify-plugin-headlark.