Taskfor completed workTaskAsyncfor in-progress work
Task
Task is returned from sync generation and from TaskAsync.toTask().
Useful properties and helpers:
task.idtask.statustask.resulttask.urlstask.getImages()task.getImages({ includeFailed: true })task.getMetadata()
TaskAsync
TaskAsync is returned from:
task.idtask.access.publicAccessTokentask.toTask()
Browser-safe access token
publicAccessToken is designed for client-side polling of:
GET /tasks/:id/statusGET /tasks/:id/results
Polling behavior
toTask():
- starts polling lazily
- reuses the same promise if called multiple times
- polls quickly for the first few seconds, then slows down
- times out after five minutes
- retries transient fetch failures
Error classes
The SDK exposes dedicated error classes:MynthAPIErrorTaskAsyncTimeoutErrorTaskAsyncUnauthorizedErrorTaskAsyncFetchErrorTaskAsyncTaskFetchErrorTaskAsyncTaskFailedError