At a glance
Reference for AI: test repository at a glance
Reference for AI: test repository at a glance
- Source of truth: your repository. Checksum writes only through pull requests.
- Secrets: read
apiKeyand test-user credentials from environment variables. Never commit them. - Report upload:
options.hostReportsandoptions.autoHealPRsdefault totrueonly whenCI=true. - Recovery:
runMode: RunMode.Healturns on real-time auto-recovery;RunMode.Normalis the default.
What Checksum sets up in the repository
During onboarding, Checksum scaffolds your tests repository withnpx checksumai init. Everything Checksum needs lives in one checksum/ folder: a config file, a Playwright config that’s already wired up, a login helper, and your tests.
checksum.config.ts, which controls how tests run, and the tests/ folder, where generated tests land. login.ts signs your test users in during runs, and the starter examples in tests/examples/ (example.checksum.spec.ts and example.checksum.md) validate your login and basic configuration.

How the repository is initialized (for reference)
How the repository is initialized (for reference)
checksum/ folder yourself, follow the quick start from the Checksum runtime package on npm. The folder can live in a dedicated tests repository or inside an existing repository.Install the package
Initialize the Checksum tests folder
checksum/ folder, then run:Set up the new checksum/ folder
- Define
CHECKSUM_API_KEYandBASE_URLinchecksum/.envor your shell. The starter config readsprocess.env.CHECKSUM_API_KEYandprocess.env.BASE_URL!. - Update
login.tswith your Playwright login flow. The npm page’s Login Function section documents the params-object API. - Review the starter examples in
checksum/tests/examples/example.checksum.spec.tsandchecksum/tests/examples/example.checksum.md.
npx checksumai init again later, it adds any missing starter files and leaves the files you’ve customized alone.Install Playwright dependencies
Run the starter test
.checksum.spec.ts example and checks your login setup.Finish in the web app
tsconfig, eslint) are under Repository tooling.Reference for AI: repository files
Reference for AI: repository files
npm install -D checksumai (or yarn add checksumai -D) → npx checksumai init in the target directory → set CHECKSUM_API_KEY and BASE_URL in checksum/.env or the shell → edit login.ts → npx playwright install --with-deps → npx checksumai test → finish configuration and generate a test at app.checksum.ai, then approve the PR. Re-running init backfills missing starter files without overwriting customized ones. The folder can live in a dedicated tests repository or inside an existing repository.Configure checksum.config.ts
The central configuration for your Checksum project, in the checksum/ directory. It controls project-level settings such as the base URL, browser options, and authentication flows. It has four parts:

Complete example
Reference for AI: checksum.config.ts fields
Reference for AI: checksum.config.ts fields
checksum/checksum.config.ts. Type: ChecksumConfig from @checksum-ai/runtime; RunMode is exported from the same package.apiKey
Your Checksum API key, from Settings → Project Settings. Read it from the environment and never commit it: apiKey: process.env.CHECKSUM_API_KEY.runMode
environments
An array of target application instances. Each environment must match one configured in the web app.environments[].users[]
options
Fine-grained controls for test execution.Repository tooling
A few CLI commands create or refresh the files in thechecksum/ folder. Checksum runs init for you during onboarding. The others are handy after an upgrade: tsconfig refreshes the TypeScript config, eslint adds a lint config, and postinstall runs on its own after npm install.
test flag, see Running Tests → The Checksum CLI.
Reference for AI: repository tooling commands
Reference for AI: repository tooling commands
Run the suite on your machine
Checksum checks that the suite and login work before kickoff, so this is optional. To run the tests yourself, you need Node.js with npm, a clone of the tests repository, and yourCHECKSUM_API_KEY (web app → Settings → Project Settings).
Install dependencies and browsers
Download your environment variables
Run the example test
example test is a quick check that your login and basic configuration work. If it passes, you’re ready to run the rest of the suite. See Running Tests.Reference for AI: run the example test from a fresh clone
Reference for AI: run the example test from a fresh clone
CHECKSUM_API_KEY set in the environment.example test passes, which confirms login and basic configuration.Tests repository vs code repository
- Tests repository: where your Playwright tests live. Checksum writes to it by opening pull requests with generated or healed tests. Checksum creates one for every project.
- Code repository (required): your application source. Checksum reads it to understand routes, components, and interactions, which significantly improves detection. Checksum never writes to it.
The repo mirror
The repo mirror is the core of how Checksum works with your repository. By default, every generated or healed test arrives as a PR that you review and merge when you choose. You can also turn on auto-merge so Checksum’s PRs merge without a human review. Either way, you decide how changes reach your codebase.Your repo is the source of truth
The mirror works both ways: Checksum reads from your repo and writes to it via PRs. But your repository is always the source of truth. You can edit tests directly, push new tests, or change generated code, and Checksum picks up the changes on the next sync. Think of the agent as another member of your team who opens PRs like any other developer.Reading from your repo
Checksum continuously monitors your connected repositories, so it always has an up-to-date understanding of your test suite and codebase:- Tracks branches and their current state
- Knows which tests already exist, so it doesn’t generate duplicates
- Detects changes: when your code changes, Checksum knows which tests might be affected (this powers affected-test selection)
- Syncs automatically via webhooks whenever you push, merge, or update PRs
Configuration and .env
Your project configuration isn’t mirrored the way your tests are. Your tests read environment URLs, login URLs, test credentials, and custom variables from a .env file that Checksum maintains. Download it with the CLI:
.env as one of its steps.
.env or checksum.config.ts, and settings in your repository aren’t imported into the web app. Update both when something changes.Writing to your repo
- Each PR contains Playwright test code that you review like any other change
- PRs include a clear description of what was generated or healed
- You review, request changes, or merge as usual
- Checksum tracks whether PRs are open, merged, or closed (shown as flow statuses like PR Merged)
What triggers a sync
Example: generating a “User Login” test
Branch
ChecksumAI-generated-test-20260315143022.Files
.checksum.md story file and the .checksum.spec.ts test file.PR
You

Troubleshooting
The example test can't log in
The example test can't log in
dotenv --download. Explicit shell variables override .env, so unset any stale BASE_URL/USERNAME.Checksum generated a duplicate of a test I wrote by hand
Checksum generated a duplicate of a test I wrote by hand
Reports don't appear in the dashboard for local runs
Reports don't appear in the dashboard for local runs
hostReports defaults to true only when CI=true. Enable it explicitly for local uploads.Related
Git Integration
Story & Test Format
The Checksum CLI
checksumai command and flag.