Skip to main content
To configure the Algolia plugin for your Netlify site, you can use the netlify.toml file and environment variables.

Usage

TOML
[[plugins]]
package = "@algolia/netlify-plugin-crawler"
  [plugins.inputs]
  branches = ['main', 'develop', 'feat/add-algolia']
  disabled = true
  pathPrefix = "/blog"
  customDomain = "example.com"
  renderJavaScript = true

Available parameters

netlify.toml

The following plugin settings are all optional.
ParameterTypeDescription
branchesString arrayList of branches the crawler should build. By default, the plugin only builds your main branch, but you can build multiple branches. Each branch has a dedicated Algolia index, named netlify_<site-id>_<branch-name>_all. Ensure you target the right branch in your frontend.
Default is ['master','main']
mainBranchStringThe main project’s branch. If defined, it’s used to propagate Algolia index setting modifications to other branches. Your main branch’s Algolia index settings will be used to create a new index when the plugin runs for the first time on a new branch.
pathprefixStringYour website’s prefix if it’s not at the root level. For example:
pathPrefix = "/blog" # Will alias "/blog" to "/"
customDomainStringThe custom domain you use (if you can’t define it through Netlify settings). For example:
# Alias "example.com" to "<your-site-url>.netlify.app"
customDomain = "example.com"
renderJavaScriptBooleanIf true, the crawler uses JavaScript to render your website. Useful for single page apps.
Default is false
templateStringUsed to modify how records and schemas are extracted.
disabledBooleanIf true, turns off the Netlify plugin but doesn’t remove it.
Default is false

Environment variables

The environment variables that needs to be set in your Netlify Site settings. They’re automatically added by the plugin.
VariableRequired?TypeDescription
ALGOLIA_BASE_URLYesStringURL to target. Should be https://crawler.algolia.com/
ALGOLIA_API_KEYYesStringAPI key to authenticate the call to the crawler
ALGOLIA_DISABLEDNoBooleanIf true, turns off the Netlify plugin but doesn’t remove it.
Default is false
I