---
title: "Configuration: fidel.config.json"
description: Every field in fidel.config.json, with types, defaults and examples, for design system checks and Figma checks on pull requests.
---

# Configuration: fidel.config.json

Fidel reads `fidel.config.json` from the root of your repository. `npx usefidel init` writes it for you. The file needs a non-empty `designSystemChecks` array, a non-empty `checks` array, or both.

## Example

```json
{
  "projectId": "0b9f2a4e-1c3d-4e5f-8a6b-7c8d9e0f1a2b",
  "designSystemChecks": [
    { "name": "Home", "url": "https://pr-{pr}.preview.example.com/" }
  ],
  "failOnDrift": false
}
```

## Top-level fields

| Field | Type | Default | Description |
|---|---|---|---|
| `designSystemChecks` | array | none | Pages to check against your design system on each pull request. See below. |
| `checks` | array | none | Pages to compare with a Figma frame. See below. |
| `failOnDrift` | boolean | `false` | Block the merge when Fidel confirms a violation in design system checks. |
| `projectId` | string | none | Project that runs are saved under. Without it, runs don't show in the web app. |
| `defaults` | object | none | Settings applied to every Figma check that doesn't set its own. |
| `triggers` | object | frontend files | Which changed files start a check. |

## designSystemChecks

Design system checks run through the [Fidel GitHub App](https://github.com/apps/use-fidel) and need the Pro plan or above.

| Field | Required | Description |
|---|---|---|
| `name` | yes | Label shown in the pull request comment. |
| `url` | yes | The page to check, usually the pull request's preview URL. Supports variables. |
| `projectId` | no | Project for this check. Defaults to the top-level `projectId`. |

## failOnDrift

Off by default, so Fidel only comments. Set it to `true` to block the merge when Fidel confirms a violation. Only `true` or `false` count; any other value is ignored.

`failOnDrift` applies to design system checks. Figma checks that run in the GitHub Action use the action's [`fail-on-drift` input](/docs/github-action/#inputs) instead.

## checks (Figma frame vs live page)

| Field | Required | Description |
|---|---|---|
| `name` | yes | Label shown in the pull request comment. |
| `figma` | yes | Link to the Figma frame, copied from Figma. |
| `url` | yes | The live or preview URL to compare. Supports variables. |
| `viewport` | no | `{ "width", "height" }`. Defaults to `1440 × 900`. |
| `waitForSelector` | no | CSS selector to wait for before capturing. |
| `waitForLoadState` | no | `load`, `domcontentloaded` or `networkidle` (default). |
| `waitAfterLoadMs` | no | Extra wait after load, in milliseconds. Defaults to `500`. |
| `textMode` | no | Text comparison mode. Defaults to `styling-only`. |
| `projectId` | no | Project for this check. Defaults to the top-level `projectId`. |

Figma checks need a connected Figma account: run `npx usefidel connect-figma`.

## defaults

Applies to every Figma check that doesn't override it. Accepts `viewport`, `waitForSelector`, `waitForLoadState`, `waitAfterLoadMs` and `textMode`.

## triggers

By default Fidel runs only when a pull request changes a frontend file:

```text
**/*.{ts,tsx,js,jsx,mjs,cjs,css,scss,sass,less,html,vue,svelte}
```

Set your own globs with `triggers.paths`:

```json
{ "triggers": { "paths": ["src/**", "styles/**"] } }
```

Supported syntax: `*` within a path segment, `**` across segments, `?` for one character and `{a,b}` for alternatives.

## Variables in url

| Variable | Value |
|---|---|
| `{pr}` | Pull request number |
| `{branch}` | Head branch name |
| `{sha}` | Head commit SHA |
| `$VAR` or `${VAR}` | Environment variable from the workflow step. GitHub Action only. |

The GitHub App doesn't expand environment variables, so design system checks use `{pr}`, `{branch}` and `{sha}`.

Fidel refuses variables whose name or value looks like a credential, and the run fails with an error naming the variable. This is a safeguard, not a guarantee: only reference values that are safe to appear in a stored run and a pull request comment.

## projectId

The id in the project's address in the web app (`/projects/<id>`). If the id doesn't belong to your team, the run is refused with `project_not_found`.

## Related

- [GitHub Action reference](/docs/github-action/)
- [Troubleshooting](/docs/troubleshooting/)
