Using GitHub instead? See the GitHub setup guide.
Prerequisite A GitLab project that already builds a Storybook (e.g. a
build-storybookjob) and Maintainer access to add CI/CD variables. Your VizDiff administrator must have configured the GitLab host and a service token for this deployment.
Press the "Sign in" button. You will be redirected to your organization's identity provider (Microsoft Entra / SSO) to authenticate, then returned to your VizDiff projects dashboard.
Press the "Add project" button on the projects dashboard. VizDiff lists the GitLab groups and projects visible to the configured service token—select a group, then pick your project.
You do not need to authorize VizDiff against your personal GitLab account: the deployment's service token reads project metadata and posts commit statuses on your merge requests on your behalf.
After the project is created you land on its page—copy the Project Token shown there.
VIZDIFF_PROJECT_TOKEN as a GitLab CI/CD variableIn GitLab, open your project's Settings → CI/CD → Variables → Add variable:
VIZDIFF_PROJECT_TOKENPoint the CLI at your self-hosted VizDiff by also setting VIZDIFF_API_URL (as another CI/CD variable, or inline in the CI file), e.g. https://vizdiff.example.com/api.
.gitlab-ci.ymlYour pipeline must build Storybook to a directory (commonly npm run build-storybook, which outputs storybook-static), then upload it with the VizDiff CLI:
vizdiff: image: node:22 variables: VIZDIFF_API_URL: "https://vizdiff.example.com/api" script: - npm ci - npm run build-storybook # outputs ./storybook-static - npx @vizdiff/cli upload ./storybook-static rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
The CLI auto-detects GitLab's predefined variables (CI_COMMIT_SHA, CI_COMMIT_REF_NAME, CI_MERGE_REQUEST_IID, and the merge-request base branch/commit), so no extra flags are needed. VIZDIFF_PROJECT_TOKEN is read from the job environment.
Open a merge request (or push to your default branch). When the upload step finishes, VizDiff posts a commit status named vizdiff/visual-tests on the pipeline commit. It stays in the "running" state while screenshots render, and if there are new or changed screenshots it remains pending until the build is approved or denied. (With no changes, it transitions to "success" automatically.)
Open the status's target link to jump to the VizDiff review page.
The review page lists every screenshot generated for the build, sorted New → Changed → Unchanged. Click a screenshot to open the comparison dialog.

Use the arrow keys or the on-screen buttons to move between screenshots, and switch between the "Old", "New", "Diff", and "2-Up" views. In the "Diff" view, changes are highlighted.

Once you've reviewed every screenshot, approve or deny the build. Either action immediately updates the GitLab commit status to "success" or "failed".
The first run of any branch establishes a baseline—every screenshot shows "New". To see real diffs, push another commit to the same merge request, or branch from a commit that already has approved screenshots. Only stories that change between the two Storybook builds appear as Changed.
VIZDIFF_PROJECT_TOKEN is missing or incorrect. Confirm the CI/CD variable exists and matches the project's token.storybook-static — make sure your pipeline builds Storybook to that directory, or pass the correct path to vizdiff upload.VIZDIFF_API_URL points at your VizDiff ingress, and that the administrator configured a GitLab service token (with api scope and Developer or higher role) for your GitLab host.GITLAB_HOSTS configuration.