# Custom config file

If you'd like to take advantages of additional features, you will need to set up the custom config file.

Create a file called `cypress-image-diff.config.js`. This should live along side `cypress.config.js`, in the root of the directory.

If your project is written in ESM module, then you would need to use .cjs instead of .js extension.

```
// cypress-image-diff.config.js
// cypress-image-diff.config.cjs
const config = {
  ROOT_DIR: 'custom-folder-name',
};

module.exports = config;
```

> **Note**: In order to make this custom config values effective, remember to return `getCompareSnapshotsPlugin` instance inside function `setupNodeEvents`:

```
export default defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
     return getCompareSnapshotsPlugin(on, config);
    },
  },
})
```

Currently supported values in the custom config file:

* [**ROOT\_DIR**](/getting-started/custom-config-file/root_dir.md)
* [**FAILURE\_THRESHOLD**](/getting-started/custom-config-file/failure_threshold.md)
* [**RETRY\_OPTIONS**](/getting-started/custom-config-file/retry_options.md)
* [**FAIL\_ON\_MISSING\_BASELINE**](/getting-started/custom-config-file/fail_on_missing_baseline.md)
* [**COMPARISON\_OPTIONS**](/getting-started/custom-config-file/comparison_options.md)
* [**JSON\_REPORT**](/getting-started/custom-config-file/json_report.md)
* [**CYPRESS\_SCREENSHOT\_OPTIONS**](https://app.gitbook.com/o/boZ108LU5mrfWT6zkLtJ/s/ZyBQte7cOp75X6TWkWrZ/~/changes/17/getting-started/custom-config-file/cypress_)
* [**REPORT\_DIR**](https://app.gitbook.com/o/boZ108LU5mrfWT6zkLtJ/s/ZyBQte7cOp75X6TWkWrZ/~/changes/17/getting-started/custom-config-file/report_dir)
* [**SCREENSHOTS\_DIR**](https://app.gitbook.com/o/boZ108LU5mrfWT6zkLtJ/s/ZyBQte7cOp75X6TWkWrZ/~/changes/17/getting-started/custom-config-file/screenshots_dir)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cypress.visual-image-diff.dev/getting-started/custom-config-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
