> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Plugin configuration

> How to configure your Netlify Plugin

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

## Usage

```toml TOML icon=file-cog theme={"system"}
[[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.

| Parameter          | Type         | Description                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------ | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `branches`         | String array | List of branches the crawler should build. By default, the plugin only builds your main branch, but you can build [multiple branches](/doc/tools/crawler/netlify-plugin/front-end#multiple-git-branches). Each branch has a dedicated Algolia index, named `netlify_<site-id>_<branch-name>_all`. Ensure you target the right branch in your [frontend](/doc/tools/crawler/netlify-plugin/front-end).<br />Default is `['master','main']` |
| `mainBranch`       | String       | The 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.                                                                                                                                                                                |
| `pathprefix`       | String       | Your website's prefix if it's not at the root level. For example:<br />`pathPrefix = "/blog" # Will alias "/blog" to "/"`                                                                                                                                                                                                                                                                                                                 |
| `customDomain`     | String       | The custom domain you use (if you can't define it through Netlify settings). For example:<br />`  # Alias "example.com" to "<your-site-url>.netlify.app"`<br />`customDomain = "example.com"`                                                                                                                                                                                                                                             |
| `renderJavaScript` | Boolean      | If `true`, the crawler uses JavaScript to render your website. Useful for [single page apps](/doc/tools/crawler/apis/configuration/render-java-script).<br />Default is `false`                                                                                                                                                                                                                                                           |
| `template`         | String       | Used to modify [how records and schemas are extracted](/doc/tools/crawler/netlify-plugin/extraction-strategy).                                                                                                                                                                                                                                                                                                                            |
| `disabled`         | Boolean      | If `true`, turns off the Netlify plugin but doesn't remove it.<br />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.

| Variable           | Required? | Type    | Description                                                                                        |
| ------------------ | --------- | ------- | -------------------------------------------------------------------------------------------------- |
| `ALGOLIA_BASE_URL` | Yes       | String  | URL to target. Should be `https://crawler.algolia.com/`                                            |
| `ALGOLIA_API_KEY`  | Yes       | String  | [API key](https://dashboard.algolia.com/account/api-keys/) to authenticate the call to the crawler |
| `ALGOLIA_DISABLED` | No        | Boolean | If `true`, turns off the Netlify plugin but doesn't remove it.<br />Default is `false`             |
