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

# ovr.config

> Set the server URL, capture viewports, and diff threshold for a project.

An `ovr.config.ts` (or `.js`/`.mjs`) file in the directory you run the CLI from configures the server URL, capture viewports, and diff threshold for a project.

```ts theme={null}
// ovr.config.ts
import { defineConfig } from "@open-visual-regression/cli/config";

export default defineConfig({
  serverUrl: "https://ovr.example.com",
  viewports: [
    { name: "desktop", width: 1280 },
    { name: "mobile", width: 375, browser: "webkit" },
  ],
  defaultViewports: ["desktop"],
  diffThreshold: 0.05,
});
```

## Options

| Option | Type | Default | Description |
| - | - | - | - |
| `serverUrl` | `string` | | OVR server URL. Overridden by a command's `--server-url` flag |
| `viewports` | `Viewport[]` | `[]` | Every viewport available, named or not |
| `defaultViewports` | `string[]` | every named viewport | Names from `viewports` captured automatically for every story |
| `diffThreshold` | `number`, `(0, 1]` | `0.05` | Fraction of pixels that may differ before a snapshot needs review |
| `waitForTimeout` | `number`, `[0, 30000]` | `0` | Milliseconds to wait before each screenshot, e.g. for slow-loading data or images |
| `onlyAffected` | `object` | | Options for [`--only-affected`](/cli/upload-storybook#only-affected-stories). See [below](#only-affected) |

<Note>
  If `viewports` is omitted, OVR falls back to a single default: 1280px wide, full page, in Chromium.
</Note>

## Viewports

Each entry in `viewports` describes one capture target:

| Field | Type | Default | Description |
| - | - | - | - |
| `name` | `string` | | References this viewport from `defaultViewports` or a story override |
| `browser` | `"chromium" \| "firefox" \| "webkit"` | `"chromium"` | |
| `width` | `number` | | |
| `height` | `number` | full page | Omit to capture the full page height instead of a fixed crop |

Unnamed viewports (no `name`) are always opt-in: they can't be referenced by `defaultViewports`, only added inline via a story override.

Individual stories can override some of these options, or skip capture entirely — see [Per-story parameters](/configuration/story-parameters).

## Only affected

Options for [`ovr upload storybook --only-affected`](/cli/upload-storybook#only-affected-stories). Globs are relative to the directory you run the CLI from.

| Field | Type | Default | Description |
| - | - | - | - |
| `externals` | `string[]` | `[]` | Files that affect every story when they change, such as a static folder |
| `untraced` | `string[]` | `[]` | Files that never affect a story |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.