day0-browser-js
v0.0.2
Published
A powerful, stealthy browser automation library built on top of Playwright, designed to be easily integrated into NestJS applications.
Readme
Day0 Browser Library
A powerful, stealthy browser automation library built on top of Playwright, designed to be easily integrated into NestJS applications.
Installation
npm install day0-browser-jsUsage
Import Module
Import the BrowserModule into your NestJS application's root module (or any other module):
import { Module } from '@nestjs/common';
import { BrowserModule } from 'day0-browser-js';
@Module({
imports: [BrowserModule],
// ...
})
export class AppModule {}Use Service
Inject BrowserService into your services or controllers:
import { Injectable } from '@nestjs/common';
import { BrowserService } from 'day0-browser-js';
@Injectable()
export class AppService {
constructor(private readonly browserService: BrowserService) {}
async performTask() {
const browser = await this.browserService.launchBrowser();
// Optional: Pass custom fingerprint or proxy
const context = await this.browserService.createContext(
browser,
myFingerprint,
{
server: 'http://proxy.com',
username: 'user',
password: 'pass',
},
);
const page = await context.newPage();
await this.browserService.applyStealth(page);
await page.goto('https://example.com');
// ... do something
await this.browserService.closeBrowser();
}
}API Endpoint
The library also exposes a controller at POST /browser/launch which accepts:
{
"timeout": 5000,
"proxy": {
"server": "http://proxy.example.com",
"username": "user",
"password": "pass"
},
"fingerprint": { ... }
}Features
- Stealth Mode: Built-in fingerprinting and stealth techniques to evade detection.
- NestJS Integration: Ready-to-use Module and Service.
- Playwright Wrapper: Full access to underlying Playwright objects.
