Configuration
All script-side configuration lives in the autowright block passed to
chromium.launch():
import { chromium } from '@autowright/browser';
const browser = await chromium.launch({ headless: true, // normal Playwright options work as usual autowright: { scriptId: 'portal-scraper', serviceUrl: 'http://localhost:4400', repoUrl: 'https://github.com/your-org/scrapers', branch: 'main', scriptPath: 'src/scraper.ts', maxFailures: 3, localArtifactDir: './autowright-artifacts/', storage: { provider: 's3', endpoint: process.env.STORAGE_ENDPOINT, bucket: process.env.STORAGE_BUCKET, accessKey: process.env.MINIO_ACCESS_KEY, secretKey: process.env.MINIO_SECRET_KEY, forcePathStyle: true, }, capture: { screenshotCount: 3, dom: true, network: true, console: true, tracing: false, }, },});Everything outside autowright is passed to Playwright untouched.
AutowrightConfig
| Field | Type | Default | Description |
|---|---|---|---|
scriptId | string | required | Stable identifier for this script. Used for registration, dedup, and artifact paths. |
serviceUrl | string | http://localhost:4400 | Where the coordination service runs. |
repoUrl | string | — | Repository the fixer clones to make the fix. Without it, failures are captured but can’t become PRs. |
branch | string | repo default | Base branch for fix PRs. |
scriptPath | string | — | Repo-relative path to this script’s source file. Tells the agent where to look first. |
maxFailures | number | 3 | Failure-count hint reported to the service. |
storage | StorageConfig | — | S3-compatible artifact storage. Without it, artifacts stay on local disk only. |
localArtifactDir | string | ./autowright-artifacts/ | Local safety-net directory — artifacts are always written here first. |
capture | object | see below | What to record during the run. |
capture
| Field | Type | Default | Description |
|---|---|---|---|
screenshotCount | number | 3 | Rolling screenshot buffer size. |
dom | boolean | true | DOM snapshot on failure. |
network | boolean | true | Network request/response log. |
console | boolean | true | Page console messages. |
tracing | boolean | false | Playwright trace (trace.zip) — richer but heavier. |
StorageConfig
| Field | Type | Description |
|---|---|---|
provider | 's3' | S3-compatible storage (MinIO, AWS S3, R2, …). |
endpoint | string | Storage endpoint URL, e.g. http://localhost:9000 for local MinIO. |
bucket | string | Bucket name, e.g. autowright-artifacts. |
accessKey / secretKey | string | Credentials. |
forcePathStyle | boolean | true for MinIO and most non-AWS stores. |
Service- and fixer-side settings (poll interval, concurrency, dedupe TTL, tokens) are environment variables — see Environment Variables.