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:
Playwright
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 variable | Values | What it controls |
|---|---|---|
| Region | euwest, uswest | Which region serves the browser |
| Token | one of your active tokens | Which token the run authenticates with |
| Browser | lightpanda, chrome | Which browser runs. Chrome is for debugging, not production traffic |
| Proxy | one of your proxies, or none | The 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:
| Package | Version |
|---|---|
playwright-core | 1.50.0 |
puppeteer-core | 24.0.0 |
The rest of the environment is fixed too:
- Language. JavaScript and TypeScript both run through tsx , so
importsyntax and top-levelawaitwork 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:
| Limit | Value |
|---|---|
| Run time | 5 minutes |
| Memory | 256 MB |
| CPU | 1 core |
| Output captured | 256 KB |
| Processes | 64 |
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.