This example is to be used with the Browserless template

Create a reference variable on your service

BROWSER_PLAYWRIGHT_ENDPOINT=${{Browserless.BROWSER_PLAYWRIGHT_ENDPOINT}}

Then use process.env.BROWSER_PLAYWRIGHT_ENDPOINT in code

Before

const browser = await playwright.chromium.launch();

After

const browser = await playwright.chromium.connect(process.env.BROWSER_PLAYWRIGHT_ENDPOINT);

The rest of your code remains the same with no other changes required.