Generate and wait for a specification
Method reference
All methods use
https://api.pre.dev by default. The constructor accepts apiKey and optional baseUrl; it has no timeout, retry, or custom-header option. Use direct HTTP when you need those controls. A polling deadline does not abort an in-flight SDK request.
Specification history and credits
File uploads
Pass a Blob with an accepted MIME type. SDK 1.1.0 encodes its{ data: Buffer, name } alternative as application/octet-stream, which the API’s file filter does not accept.
docURLs correctly for multipart requests. It generates a filename for Blob uploads; use direct multipart HTTP if preserving the original filename matters. See accepted formats and limits.
Run browser tasks and poll
status to detect completion and inspect every task result. The current TypeScript declarations lag some REST fields, including running stubs and nullable result slots; guard missing values at runtime. Published task types do not declare mode, maxSteps, or maxDurationSeconds; use direct REST when your integration needs those controls without extending the package’s types.
Stream a new browser submission
stream: true returns an async generator; synchronous and async-submission modes return a Promise. The stream example creates a new run. Streamed error frames raise exceptions. To attach to an existing run, use direct HTTP SSE.
Browser history and evidence
includeEvents for routine polling. See status and results for event shapes and per-task fields.
Errors
statusCode property. Browser gate errors have typed subclasses; see errors and retries. An Architect 402 without a machine-readable browser gate code raises PredevAPIError. Use direct REST for an idempotency key; the SDK does not forward arbitrary options as headers or request fields.
See the npm package or the SDK source.
