Skip to content
Dashboard
Getting Started

Quickstart

Go from zero to a working browser session in under 5 minutes.

Terminal window
pip install tzafon
Terminal window
npm install @tzafon/lightcone

Sign up at lightcone.ai and copy your API key from the dashboard.

Set it as an environment variable:

Terminal window
export TZAFON_API_KEY=sk_your_api_key_here
quickstart.py
from tzafon import Lightcone
client = Lightcone()
with client.computer.create(kind="browser") as computer:
computer.navigate("https://wikipedia.org")
computer.wait(2)
result = computer.screenshot()
print(computer.get_screenshot_url(result))
# The session terminates automatically when the block exits
quickstart.ts
import Lightcone from "@tzafon/lightcone";
const client = new Lightcone();
const computer = await client.computers.create({ kind: "browser" });
await client.computers.navigate(computer.id!, { url: "https://wikipedia.org" });
const result = await client.computers.screenshot(computer.id!);
console.log(result.result?.screenshot_url);
await client.computers.delete(computer.id!);

Run it:

Terminal window
python your_script.py
Terminal window
npx tsx your_script.ts

You should see a screenshot URL printed to the console. Open it in your browser to see the captured page.

The output looks something like:

https://screenshots.tzafon.ai/abc123-def456.png
  1. Created a sandboxed Chromium browser session in the cloud
  2. Navigated to Wikipedia
  3. Captured a screenshot and got back a URL
  4. Terminated the session (automatically in Python, explicitly in TypeScript)

The whole process takes about 3–5 seconds.

You can configure the session when you create it:

with client.computer.create(
kind="browser",
timeout_seconds=3600,
inactivity_timeout_seconds=120,
display={"width": 1280, "height": 720, "scale": 1.0},
) as computer:
# ...
const computer = await client.computers.create({
kind: "browser",
timeout_seconds: 3600,
inactivity_timeout_seconds: 120,
display: { width: 1280, height: 720, scale: 1.0 },
});
ParameterDescription
kind"browser" for web automation, "desktop" for full Linux desktop
timeout_secondsMaximum session lifetime (default: plan-dependent)
inactivity_timeout_secondsIdle timeout before auto-termination (default: plan-dependent)
displayViewport dimensions and scale factor
persistentSave cookies/storage for reuse across sessions (default: false)
use_advanced_proxyRoute through residential proxy for stealth (default: false)