--- title: Quickstart | Lightcone description: Go from zero to a working browser session in under 5 minutes. --- ## 1. Install the SDK Terminal window ``` pip install tzafon ``` Terminal window ``` npm install @tzafon/lightcone ``` ## 2. Get your API key Sign up at [lightcone.ai](https://lightcone.ai) and copy your API key from the [dashboard](https://lightcone.ai/developer). Set it as an environment variable: Terminal window ``` export TZAFON_API_KEY=sk_your_api_key_here ``` Add this to your `.env` file so it persists across terminal sessions. ## 3. Create a browser and take a screenshot 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!); ``` The TypeScript SDK returns optional types for fields like `id`. The non-null assertion (`!`) is safe here because `id` is always present after successful creation. You’ll see this pattern throughout the TypeScript examples. The Python SDK has a high-level `client.computer.create()` wrapper with automatic cleanup via `with`. The TypeScript SDK also has a high-level `ComputerSession` class with the same convenience methods — see the [Computers](/guides/computers/index.md) page for details. The examples in these docs use the lower-level `client.computers` resource for explicitness. 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 ``` ## What just happened? 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. ## Customize the session 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 }, }); ``` | Parameter | Description | | ---------------------------- | ------------------------------------------------------------------ | | `kind` | `"browser"` for web automation, `"desktop"` for full Linux desktop | | `timeout_seconds` | Maximum session lifetime (default: plan-dependent) | | `inactivity_timeout_seconds` | Idle timeout before auto-termination (default: plan-dependent) | | `display` | Viewport dimensions and scale factor | | `persistent` | Save cookies/storage for reuse across sessions (default: `false`) | | `use_advanced_proxy` | Route through residential proxy for stealth (default: `false`) | ## Next steps - [**Computers**](/guides/computers/index.md) — understand sessions, lifecycle, and all available actions - [**Automate a browser**](/guides/automate-a-browser/index.md) — end-to-end browser automation walkthrough - [**Run an agent**](/guides/run-an-agent/index.md) — let AI complete tasks autonomously - [**How Lightcone works**](/guides/how-lightcone-works/index.md) — architecture and the three API layers