In https://lightpanda.io/docs/quickstart/your-first-test, you pass directly the endpointURL value to chromium.connectOverCDP followed by an options object (eg headers).
// "use strict" <-- redundant when you use ESM
import { lightpanda } from "@lightpanda/browser";
import { chromium } from "playwright-core";
const lpdopts = {
host: "127.0.0.1",
port: 9222,
};
const endpointURL = "ws://" + lpdopts.host + ":" + lpdopts.port;
(async () => {
// Start Lightpanda browser in a separate process.
const proc = await lightpanda.serve(lpdopts);
// Connect using Playwright's chromium driver to the browser.
const browser = await chromium.connectOverCDP(endpointURL, {}); // options
...