@chegger/node-obscura
v0.1.0
Published
Node.js runtime wrapper for the Obscura browser binary.
Maintainers
Readme
@chegger/node-obscura
Tiny Node.js wrapper around the Obscura browser binary.
It downloads the matching Obscura release artifact at install time and exposes a small runtime API so you can start obscura serve and connect with Playwright or Puppeteer over CDP.
Install
npm install @chegger/node-obscuraSupported today:
- Linux x64
- macOS arm64
- macOS x64
Usage
const { chromium } = require('playwright-core');
const { startObscura } = require('@chegger/node-obscura');
async function main() {
const obscura = await startObscura({ stealth: true });
const browser = await chromium.connectOverCDP(obscura.endpoint);
try {
const context = browser.contexts()[0] || (await browser.newContext());
const page = await context.newPage();
await page.goto('https://example.com');
console.log(await page.title());
} finally {
await browser.close();
await obscura.close();
}
}
main().catch((error) => {
console.error(error);
process.exit(1);
});API
getBinaryPath()
Returns the installed Obscura binary path for the current platform.
startObscura(options?)
Starts obscura serve and resolves when the CDP endpoint is ready.
Options:
port?: numberhost?: stringstealth?: booleanstartupTimeoutMs?: numberextraArgs?: string[]
Returns:
{
endpoint: string;
wsEndpoint: string;
close: () => Promise<void>;
}Environment variables
OBSCURA_RELEASE_TAGoverrides the release tag to download. Default:v0.1.1OBSCURA_DOWNLOAD_BASE_URLoverrides the GitHub release base URLNODE_OBSCURA_SKIP_DOWNLOAD=1skips binary download during install
Notes
- This package does not bundle
playwright-coreorpuppeteer-core; install your preferred CDP client separately. - The package currently downloads upstream release binaries rather than building Obscura from source.
