TS/JS SDK Overview
Contributions are welcome at https://github.com/CloudCruise/cloudcruise-js. Report bugs via GitHub issues or Discord. The CloudCruise TypeScript/JavaScript SDK provides a simple way to integrate browser automation workflows into your applications. Execute workflows, manage credentials, and monitor runs programmatically.Installation
Install the latest version:1. Creating a Run
workflow_version (an exact version or semver range such as "1.2.3", "^1.2.0" or "1.x"; the highest matching release runs) or workflow_branch_id (that branch’s latest version runs) to pin it. Workflows shows how to list versions and branches, and Workflow Versioning explains what each version bump means and which pin to choose.
The server validates run_input_variables against the input schema of the version that runs. Invalid input rejects with InputValidationError.
2. Listening to run events
Use typed per-event listeners for the best DX. Alternatively, you can attach a single'run.event' listener and switch on message.data.event.
Other available events
- ‘open’: connection established
- ‘ping’: heartbeat messages
- ‘reconnect’: reconnect attempts with
{ attemptDelayMs } - ‘message’: catch-all mirror of
'run.event'and'ping' - ‘close’: connection closed (informational)
- ‘error’: SSE errors
- ‘end’: the run reached a final status (
execution.success,execution.failedorexecution.stopped; see Run Statuses)
Async iteration (streaming)
If you prefer a loop:- Tip: Use Option A for strongly-typed handlers when you know the events you care about. Use Option B for centralized routing/logging. Both can be combined (e.g., typed listeners for your primary events plus a catch-all logger).
3. Wait for Completion
You can wait for the run to finish, but keep in mind if your run is long, this can be a very long time:Watching a Live Session
While a session is running, fetch a viewer URL to watch its browser stream:url is single-use — reopening a previously used viewer link (reloading the tab, or opening it later) fails to connect. Call getLiveViewConnection again to mint a fresh link instead of reusing the old one. This only works while the session is still active.
Next Steps
- Explore the Run API for detailed workflow execution options
- Learn about Vault API for secure credential management
- Check out Workflow API to manage your workflows
- Set up Webhooks for event notifications

