Class: Browserable
The main SDK class that provides access to all Browserable functionality.Constructor
Parameters
apiKey
(required): Your Browserable API keybaseURL
(optional): Override the default API base URL
Task Methods
createTask
Create a new automated browser task.Parameters
task
: Natural language description of what you want to automateagent
: Agent (defaults to'BROWSER_AGENT'
)
listTasks
List all tasks for the authenticated user.Parameters
listTaskRuns
List all runs for a specific task.Parameters
getTaskRunStatus
Get the status of a specific task run.Response Type
getTaskRunResult
Get the results of a specific task run.Response Type
stopTaskRun
Stop a running task execution.stopTask
Stop a task from running future executions.waitForRun
Wait for a task run to complete or error out, with status monitoring.Parameters
taskId
(required): The ID of the task to monitorrunId
(optional): The specific run ID to monitor. If not provided, monitors the most recent runoptions
(optional): Configuration options for the wait operationpollInterval
: Time in milliseconds between status checks (default: 1000ms)timeout
: Maximum time to wait in milliseconds (default: 5 minutes)onStatusChange
: Callback function for status updates
- The task completes successfully (returns the result)
- The task errors out (returns the error result)
- The timeout is reached (throws an error)
- A network or other error occurs (throws an error)
getTaskRunGifStatus
Get the GIF status and URL for a task run. The GIF is automatically generated from the browser screenshots taken during the task execution.Parameters
taskId
(required): The ID of the taskrunId
(optional): The specific run ID to get the GIF for. If not provided, returns the GIF status for the most recent run
pending
: GIF is being generatedcompleted
: GIF is ready and can be accessed via theurl
fielderror
: GIF generation failed, check theerror
field for details
check
Verify if your API key is valid.Common Types
ApiResponse
All methods return a Promise that resolves to anApiResponse
object: