@skyvern/client package wraps the Skyvern REST API in a typed TypeScript client with built-in browser automation via Playwright.
Requires Node.js 18+. Also compatible with Bun, Deno, and Cloudflare Workers.
Initialize the client
TheSkyvern class provides both API methods and browser automation. All API methods return promises:
Constructor parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
apiKey | string | — | Required. Your Skyvern API key. Get one at app.skyvern.com/settings. |
environment | SkyvernEnvironment | string | Cloud | Target environment. Options: Cloud, Staging, Local. |
baseUrl | string | undefined | Override the API base URL. Use this for self-hosted deployments. |
timeoutInSeconds | number | 60 | HTTP request timeout in seconds. |
maxRetries | number | 2 | Number of times to retry failed requests. |
headers | Record<string, string> | undefined | Additional headers included with every request. |
Environments
The SDK ships with three built-in environment URLs:| Environment | URL | When to use |
|---|---|---|
SkyvernEnvironment.Cloud | https://api.skyvern.com | Skyvern Cloud (default) |
SkyvernEnvironment.Staging | https://api-staging.skyvern.com | Staging environment |
SkyvernEnvironment.Local | http://localhost:8000 | Local server started with skyvern run server |
baseUrl instead:
waitForCompletion
By default, runTask and runWorkflow return immediately after the run is queued — you get a run_id and need to poll getRun() yourself. Pass waitForCompletion: true to have the SDK poll automatically until the run reaches a terminal state (completed, failed, terminated, timed_out, or canceled):
| Parameter | Type | Default | Description |
|---|---|---|---|
waitForCompletion | boolean | false | Poll until the run finishes. |
timeout | number | 1800 | Maximum wait time in seconds. Throws Error if exceeded. |
runTask, runWorkflow, login, and downloadFiles.
Request options
Every method accepts an optional second parameter for per-request overrides of timeout, retries, headers, and abort signal:| Parameter | Type | Description |
|---|---|---|
timeoutInSeconds | number | HTTP timeout for this request. |
maxRetries | number | Retry count for this request. |
abortSignal | AbortSignal | Signal to abort the request. |
apiKey | string | Override the API key for this request. |
headers | Record<string, string> | Additional headers for this request. |
Next steps
Tasks
Run browser automations with
runTaskWorkflows
Create and run multi-step automations
Browser Automation
Control cloud browsers with Playwright + AI
Error Handling
Handle errors and configure retries

