Skip to content

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

FieldTypeDefaultDescription
scriptIdstringrequiredStable identifier for this script. Used for registration, dedup, and artifact paths.
serviceUrlstringhttp://localhost:4400Where the coordination service runs.
repoUrlstringRepository the fixer clones to make the fix. Without it, failures are captured but can’t become PRs.
branchstringrepo defaultBase branch for fix PRs.
scriptPathstringRepo-relative path to this script’s source file. Tells the agent where to look first.
maxFailuresnumber3Failure-count hint reported to the service.
storageStorageConfigS3-compatible artifact storage. Without it, artifacts stay on local disk only.
localArtifactDirstring./autowright-artifacts/Local safety-net directory — artifacts are always written here first.
captureobjectsee belowWhat to record during the run.

capture

FieldTypeDefaultDescription
screenshotCountnumber3Rolling screenshot buffer size.
dombooleantrueDOM snapshot on failure.
networkbooleantrueNetwork request/response log.
consolebooleantruePage console messages.
tracingbooleanfalsePlaywright trace (trace.zip) — richer but heavier.

StorageConfig

FieldTypeDescription
provider's3'S3-compatible storage (MinIO, AWS S3, R2, …).
endpointstringStorage endpoint URL, e.g. http://localhost:9000 for local MinIO.
bucketstringBucket name, e.g. autowright-artifacts.
accessKey / secretKeystringCredentials.
forcePathStylebooleantrue for MinIO and most non-AWS stores.

Service- and fixer-side settings (poll interval, concurrency, dedupe TTL, tokens) are environment variables — see Environment Variables.