@mayurajs/browser-browserless
v1.2.0
Published
Browserless browsers for mayura/browser, hosted or self-hosted.
Readme
@mayurajs/browser-browserless
Browserless browsers for mayura/browser, hosted or self-hosted: each is a fresh
browser that Browserless launches when its CDP connection opens and ends when it closes. From any runtime, with no
dependency.
npm install mayura @mayurajs/browser-browserlessimport { createBrowsers } from 'mayura/browser';
import { browserlessBrowsers } from '@mayurajs/browser-browserless';
const browsers = createBrowsers(browserlessBrowsers({ token }), {
maxBrowsers: 2, maxLifetimeMs: 15 * 60_000,
origins: ['https://example.com'],
});
const browser = await browsers.open();
await browser.goto('https://example.com/');
await browser.release();- Each browser is one connection to Browserless: nothing is kept between browsers (this is not Browserless's
persistent Session API). Releasing the browser closes the connection, which ends it; Browserless ends it at its
lifetime, given as the connection's
timeout, should that never happen. Browserless's plans cap a browser at 2 minutes to an hour. - Since every connection is a browser of its own, a browser gives no
cdpendpoint to other clients: Stagehand and@mayurajs/browser-agent-browsercannot join it. - Hosted regions are
production-sfo(the default),production-lonandproduction-ams. For your own Browserless, giveendpoint, such aswss://browserless.internal; plainws://only on this machine. - Ad blocking and stealth are off unless asked for; no proxy is used. There is no live view.
- The token travels in the connection's query, as Browserless takes it: treat the URL as a secret; Mayura never logs it.
- Origins are enforced inside the browser, by intercepting its requests over CDP; a live check against Browserless confirmed it on October 6, 2026. Should a connection ever not allow that, opening a browser fails rather than running unchecked.
- Options:
token,region,endpoint,blockAds,stealth,maxLifetimeMs(1 hour).
See the browser guide. Apache-2.0.
