Skip to content
Dashboard

Create a new computer instance

client.computers.create(ComputerCreateParams { auto_kill, context_id, display, 7 more } body?, RequestOptionsoptions?): ComputerResponse { id, auto_kill, created_at, 8 more }
POST/computers

Create a new automation session. Set kind to "browser" for web automation or "desktop" for OS-level automation. Defaults to "browser" if not specified. timeout_seconds controls max lifetime, inactivity_timeout_seconds controls idle timeout, and auto_kill disables only the idle timeout (max lifetime still applies).

ParametersExpand Collapse
body: ComputerCreateParams { auto_kill, context_id, display, 7 more }
auto_kill?: boolean

If true (default), kill session after inactivity

context_id?: string
display?: Display
height?: number
scale?: number
width?: number
environment_id?: string
inactivity_timeout_seconds?: number

Idle timeout before auto-kill

kind?: string

"browser" (default) or "desktop"

persistent?: boolean

Persist cookies/storage state to DB on session teardown only if true

stealth?: unknown
timeout_seconds?: number
use_advanced_proxy?: boolean

If true (browser sessions), use ADVANCED_PROXY_URL on session start

ReturnsExpand Collapse
ComputerResponse { id, auto_kill, created_at, 8 more }
id?: string
auto_kill?: boolean
created_at?: string
endpoints?: Record<string, string>
expires_at?: string
idle_expires_at?: string
inactivity_timeout_seconds?: number
kind?: string
last_activity_at?: string
max_lifetime_seconds?: number
status?: string

Create a new computer instance

import Lightcone from '@tzafon/lightcone';

const client = new Lightcone({
  apiKey: process.env['TZAFON_API_KEY'], // This is the default and can be omitted
});

const computerResponse = await client.computers.create();

console.log(computerResponse.id);
{
  "id": "id",
  "auto_kill": true,
  "created_at": "created_at",
  "endpoints": {
    "foo": "string"
  },
  "expires_at": "expires_at",
  "idle_expires_at": "idle_expires_at",
  "inactivity_timeout_seconds": 0,
  "kind": "kind",
  "last_activity_at": "last_activity_at",
  "max_lifetime_seconds": 0,
  "status": "status"
}
Returns Examples
{
  "id": "id",
  "auto_kill": true,
  "created_at": "created_at",
  "endpoints": {
    "foo": "string"
  },
  "expires_at": "expires_at",
  "idle_expires_at": "idle_expires_at",
  "inactivity_timeout_seconds": 0,
  "kind": "kind",
  "last_activity_at": "last_activity_at",
  "max_lifetime_seconds": 0,
  "status": "status"
}