Skip to Content

Playground

The playground is a code editor in the console that runs your automation scripts on Lightpanda Cloud.

Write and run a script

Your script reaches the browser through CDP_WS_URL, an environment variable the playground sets for you:

import { chromium } from 'playwright-core'; // Connect Playwright's chromium driver to the browser. const browser = await chromium.connectOverCDP(process.env.CDP_WS_URL); const context = await browser.newContext({}); const page = await context.newPage(); await page.goto('https://wikipedia.com/'); const title = await page.locator('h1').textContent(); console.log(title); await page.close(); await context.close(); await browser.close();

What CDP_WS_URL contains

You do not need to hard-code a token in your script. CDP_WS_URL holds the WebSocket address your client uses to reach the browser over the Chrome DevTools Protocol (CDP), assembled from the choices in the Default variables panel:

Default variableValuesWhat it controls
Regioneuwest, uswestWhich region serves the browser
Tokenone of your active tokensWhich token the run authenticates with
Browserlightpanda, chromeWhich browser runs. Chrome is for debugging, not production traffic
Proxyone of your proxies, or noneThe outbound IP the browser uses

Pass process.env.CDP_WS_URL to whichever client you use.

console.log(process.env.CDP_WS_URL) prints ***, not the URL. The URL carries an access token created for the run, and run output is stored in the console, so the playground masks the URL wherever it appears in output.

What the runtime provides

Scripts run in an isolated container. Both CDP clients are preinstalled at fixed versions, so there is no install step:

PackageVersion
playwright-core1.50.0
puppeteer-core24.0.0

The rest of the environment is fixed too:

  • Language. JavaScript and TypeScript both run through tsx, so import syntax and top-level await work in either without configuration.
  • Packages. You cannot install anything beyond the two clients above.
  • Filesystem. Read-only, apart from a writable /tmp.

Every run is capped:

LimitValue
Run time5 minutes
Memory256 MB
CPU1 core
Output captured256 KB
Processes64

A run that reaches 5 minutes stops and reports timeout running program. Output beyond 256 KB is dropped, and the run is flagged as truncated.

These caps apply to the script process. The browser session driven by the script also counts toward your plan limits.

The Runs page shows your run history and output for the past 30 days.