# Public gallery

> Publish approved screenshots at stable public URLs, with a JSON manifest, for docs, READMEs and product pages that update themselves when a change is approved.

Source: https://visualci.com/docs/gallery/
All of VisualCI's documentation: https://visualci.com/llms.txt

VisualCI can serve the screenshots your tests take on your own pages: the docs, a README, a product page. Each published screenshot has one stable URL that always serves its approved version on the default branch, so the pictures on your site change when an agent approves a change, with no images in git.

## Choose what's public

Name groups of screenshots in `visualci.yml`. Nothing is public unless a group includes it:

```yaml
gallery:
  groups:
    - name: iOS
      include: ["ios/**"]
    - name: Web
      title: In the browser
      include: ["screenshots/**/1440-*", "screenshots/**/390-*"]
```

The `gallery` section needs VisualCI's CLI 0.2.4 or later (and the GitHub Action at `v0.2.4` or later): an older CLI refuses a `visualci.yml` with fields it doesn't know.

Each group has a `name`, an optional `title`, and `include`: snapshot globs, where `*` stays within one segment of the name and `**` crosses them. A screenshot belongs to the first group that includes it. Only screenshots (images) are published, and only from CI, never from a laptop.

The newest CI build on the default branch decides the groups, so a change to them goes live when it merges.

## What's served

Always the approved version on the default branch: what the next build there would compare with. A pull request's change, a pending change or a rejected one never reaches the public URL. Approving the change is what publishes it.

- **One image per screenshot:** `https://app.visualci.com/g/<org>/<project>/<name>.png`, for example `/g/acme/web/screenshots/home/1440-light.png`. It serves the image exactly as your test saved it, in its own format (`.png`, `.jpg` or `.webp`). A name that exists on more than one platform gets `@<platform>` before the extension.
- **The manifest:** `https://app.visualci.com/g/<org>/<project>.json` lists the groups in order, and each screenshot's name, platform, URL, size and hash:

```json
{
  "project": "acme/web",
  "groups": [
    {
      "name": "Web",
      "title": "In the browser",
      "items": [
        {
          "name": "screenshots/home/1440-light",
          "platform": "",
          "url": "https://app.visualci.com/g/acme/web/screenshots/home/1440-light.png",
          "width": 1440,
          "height": 900,
          "sha256": "9f2c…",
          "since": "2026-12-01T09:12:44+00:00"
        }
      ]
    }
  ]
}
```

The manifest changes only when an image does, so a site can build its own gallery from it. Light and dark, or phone and desktop, are separate screenshots with their own URLs; pairing them is up to your page.

Both URLs work from any site (`Access-Control-Allow-Origin: *`). They take no query parameters: anything else is a 404.

## Caching and cost

Cloudflare keeps each image and the manifest for a day, and VisualCI clears its copy of exactly the URLs an approval changes, so a new version shows up within seconds. Browsers check again after five minutes.

An image VisualCI's own servers send (the first request after an approval, or after Cloudflare's day runs out) costs its organization one credit. Requests Cloudflare answers, 304s, 404s and the manifest are free. A gallery keeps working when the organization is out of credits; see [Credits and plans](https://visualci.com/docs/reference/credits.md).

## See and turn off

The project's **Settings** tab lists everything that's public, with a switch that takes the whole gallery down. `get_project` over MCP returns the same list as `gallery`, and `update_project` with `gallery_enabled: false` turns it off.
