npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mydisctsolver-bbre

v2.0.2

Published

MyDisct Solver BBRE - Browser-Backed Request Engine Client Library

Readme

MyDisct Solver BBRE - Node.js

npm version License: MIT Node.js Version

Browser-Backed Request Engine - Real Browser Requests, Zero Detection

WebsiteDocumentationDiscordGitHub


Overview

BBRE (Browser-Backed Request Engine) is a next-generation HTTP request engine that routes every request through real browser environments. Unlike traditional HTTP libraries - whose requests are trivially fingerprinted and blocked by modern anti-bot systems - BBRE generates traffic that is indistinguishable from genuine human browsing.

Every outgoing request carries authentic TLS/JA3 fingerprints, correct HTTP/2 header ordering, real cookie handling, and full JavaScript execution capabilities. The engine automatically generates unique browser fingerprint profiles for each session, including realistic user agents, screen resolutions, WebGL/Canvas parameters, timezone settings, hardware concurrency values, and device memory signatures.

BBRE is purpose-built for developers who need to interact with websites protected by advanced anti-bot and WAF systems such as Cloudflare Bot Management, Akamai Bot Manager, DataDome, PerimeterX, Imperva, Shape Security, and Amazon WAF.

Automatic CAPTCHA Solving

BBRE automatically solves any CAPTCHA challenge encountered during requests - including Cloudflare Turnstile, hCaptcha, reCAPTCHA, FunCaptcha, GeeTest, and 46+ other types - in real-time with 99.9% accuracy and an average solving speed of 1.8 seconds. You do not need to detect, extract, or handle CAPTCHAs yourself. The engine handles the entire challenge-response cycle transparently, so your code receives the final result as if the CAPTCHA never existed.

Two Operation Modes

  • Passive Mode - Fast HTTP requests with browser-level TLS stealth. No page rendering or JS execution. Ideal for API calls, data fetching, and high-volume tasks.
  • Adaptive Mode - Full browser automation with a persistent browser instance. Navigate pages, fill forms, click buttons, scroll, take screenshots, execute JavaScript, and maintain state across actions. Ideal for login workflows, multi-step forms, JavaScript-heavy SPAs, and complex interaction sequences.

Features

  • Real browser environment for every request - authentic TLS/JA3 fingerprints and HTTP/2 header ordering
  • Automatic CAPTCHA solving (46+ types including Cloudflare, hCaptcha, reCAPTCHA) with 99.9% accuracy
  • Bypasses Cloudflare, Akamai, DataDome, PerimeterX, Imperva, Shape Security, Amazon WAF
  • Two operation modes: Passive (fast HTTP) and Adaptive (full browser automation)
  • Three sensibility levels: low, medium, high - controlling anti-detection aggressiveness
  • Automatic browser fingerprint generation (UserAgent, WebGL, Canvas, Timezone, Screen, GPU, RAM, CPU cores)
  • Session management with persistent cookies, local storage, and browser state
  • Full browser automation API: navigate, click, fill, type, select, checkbox, scroll, screenshot, execute JS
  • Batch actions and multi-step workflow support (submitForm, runSteps, interact, checkPage)
  • Hybrid workflow support: combine passive and adaptive modes in a single pipeline
  • Proxy support (HTTP, HTTPS, SOCKS4, SOCKS5) with authentication
  • Cookie management in three formats: string, object, and array
  • Browser speed control: instant, fast, human - simulating different interaction speeds
  • Pay-as-you-go pricing with no subscription required
  • Account balance, usage statistics, and session history API
  • Full TypeScript definitions included
  • Node.js 14+ compatible
  • Single dependency (axios)

Installation

npm install mydisctsolver-bbre

Quick Start

Simple GET Request (Passive Mode)

const BBREClient = require('mydisctsolver-bbre');

const client = new BBREClient({
  apiKey: 'YOUR_API_KEY'
});

const response = await client.get('https://example.com/api/data');
console.log('Status:', response.statusCode);
console.log('Body:', response.body);
console.log('Cookies:', response.cookies);

Browser Automation (Adaptive Mode)

const { BBRESession } = require('mydisctsolver-bbre');

const session = new BBRESession({
  apiKey: 'YOUR_API_KEY',
  mode: 'adaptive',
  sensibility: 'high'
});

await session.start();

await session.browser.navigate('https://example.com/login');
await session.browser.fill('#email', '[email protected]');
await session.browser.fill('#password', 'securePassword');
await session.browser.click('#login-button');
await session.browser.waitForSelector('.dashboard');

const title = await session.browser.getTitle();
console.log('Page title:', title);

await session.close();

System Architecture

BBRE is a distributed cloud service. Your application communicates with the BBRE API through this SDK, and the engine handles everything else - browser management, fingerprint generation, CAPTCHA solving, proxy routing, and response capture - entirely on the server side.

┌─────────────────┐          ┌──────────────────────────────────────────────────┐
│                  │          │              BBRE Cloud Engine                   │
│   Your App      │  HTTPS   │                                                  │
│   (SDK Client)  │─────────▶│  Authentication ─▶ Task Routing ─▶ Browser Pool  │
│                  │◀─────────│                                                  │
│                  │          │  ┌────────────────────────────────────────────┐  │
└─────────────────┘          │  │  Per-Request:                              │  │
                             │  │  • Unique fingerprint profile generated    │  │
                             │  │  • Real browser instance allocated         │  │
                             │  │  • TLS/JA3 fingerprint authentic           │  │
                             │  │  • CAPTCHAs solved automatically           │  │
                             │  │  • Proxy applied if configured             │  │
                             │  │  • Response captured and returned          │  │
                             │  └────────────────────────────────────────────┘  │
                             └──────────────────────────────────────────────────┘

What Happens When You Send a Request

  1. Your application calls client.get() or session.browser.navigate() through the SDK
  2. The SDK sends an authenticated request to the BBRE API with your x-api-key
  3. The API validates your credentials, checks your balance, and creates a task
  4. A real browser instance is allocated with a unique fingerprint profile
  5. Your request is executed inside the browser environment with all anti-detection measures active
  6. If a CAPTCHA is encountered at any point, it is solved automatically and transparently
  7. The response (status code, headers, body, cookies, profile) is captured and returned to the SDK
  8. The SDK parses the response and returns it to your application

Execution Patterns

BBRE supports two execution patterns:

  • Synchronous (sync: true) - The SDK calls /request/execute, which blocks until the result is ready and returns everything in a single response. Simple to use, ideal for quick requests.
  • Asynchronous (default) - The SDK calls /request/create to get a taskId, then polls /request/result until the task completes. Better for long-running requests and parallel processing. The SDK handles polling automatically.

Request Modes

Passive Mode

Passive mode routes HTTP requests through a real browser environment to generate authentic TLS fingerprints and browser-level headers, but does not render the page or execute client-side JavaScript. This makes it significantly faster and more cost-effective than adaptive mode.

const response = await client.get('https://example.com/api/products', {
  mode: 'passive',
  sensibility: 'medium'
});

console.log(response.statusCode);  // 200
console.log(response.data);        // Parsed JSON if content-type is application/json
console.log(response.cookies);     // Cookies set by the server

When to use Passive Mode:

  • Fetching API responses from endpoints that check TLS fingerprints
  • Downloading page content from sites with basic bot protection
  • Making authenticated requests with existing cookies or tokens
  • High-volume data collection where speed is the priority
  • Accessing REST APIs that reject requests from standard HTTP libraries (axios, fetch, requests)

Adaptive Mode

Adaptive mode allocates a full browser instance that you control through the session.browser API. The browser maintains state across multiple actions - cookies, local storage, session storage, and all browser-level data persist throughout the session lifecycle. Any CAPTCHA encountered during navigation is solved automatically.

const { BBRESession } = require('mydisctsolver-bbre');

const session = new BBRESession({
  apiKey: 'YOUR_API_KEY',
  mode: 'adaptive',
  sensibility: 'high'
});

await session.start();

// Full browser control - CAPTCHAs are solved automatically if encountered
await session.browser.navigate('https://example.com');
await session.browser.waitForSelector('#content');
const html = await session.browser.getHtml();
const screenshot = await session.browser.screenshot({ fullPage: true });

await session.close();

When to use Adaptive Mode:

  • JavaScript-heavy single-page applications (React, Vue, Angular)
  • Login flows with CSRF tokens, multi-step verification, or CAPTCHA challenges
  • Form submissions that require clicking, typing, and selecting
  • Sites that serve JavaScript challenges before showing content
  • Workflows that span multiple pages with state persistence
  • Taking screenshots for verification or monitoring
  • Executing custom JavaScript in the page context

Mode Comparison

| Feature | Passive Mode | Adaptive Mode | |---------|-------------|---------------| | Speed | 2-5x faster | Full browser rendering | | Cost | Lower per request | Higher per request | | TLS Fingerprint | Authentic | Authentic | | JavaScript Execution | Not available | Full support | | Browser Automation | Not available | Full support (click, fill, navigate, screenshot) | | CAPTCHA Solving | Automatic | Automatic | | Session Support | Available | Available | | Best For | API calls, data fetching, high-volume | Login flows, SPAs, multi-step workflows |


Sensibility Levels

Sensibility controls how aggressively BBRE applies anti-detection measures. Higher sensibility means more stealth but slower execution. The level affects timing patterns, header randomization, fingerprint complexity, and behavioral simulation.

| Level | Speed | Anti-Detection | Fingerprint Detail | Timing | Recommended For | |-------|-------|----------------|-------------------|--------|-----------------| | low | Fastest | Basic | Standard profile | No artificial delays | Low-security targets, testing, internal APIs | | medium | Moderate | Standard | Detailed profile with WebGL | Moderate randomization | Most websites (default) | | high | Slowest | Maximum | Full profile with WebGL/Canvas spoofing | Human-like patterns | Cloudflare, Akamai, DataDome, PerimeterX |

// Set globally
const client = new BBREClient({
  apiKey: 'YOUR_API_KEY',
  sensibility: 'high'
});

// Or per-request
const response = await client.get('https://protected-site.com', {
  sensibility: 'high'
});

Performance Note: High sensibility requests can take 2-5x longer than low sensibility requests due to additional behavioral simulation. Only use high sensibility when the target actively blocks lower sensibility requests.


Fingerprint Engineering

Every BBRE session generates a unique, internally consistent browser fingerprint profile. The engine selects hardware parameters that are realistic and coherent - a Windows machine will not report an Apple GPU, and a mobile device will have appropriate touch points and screen dimensions.

The generated profile includes:

| Parameter | Description | Example Values | |-----------|-------------|----------------| | userAgent | Browser user agent string | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/131.0.6778.140 | | platform | OS identifier | Win32, MacIntel, Linux x86_64, Linux armv81 | | screenWidth / screenHeight | Screen resolution | 1920x1080, 2560x1440, 412x915 (mobile) | | deviceMemory | RAM in GB | 4, 8, 16, 32 | | hardwareConcurrency | CPU core count | 4, 6, 8, 12, 16 | | webglVendor | GPU vendor | Google Inc. (NVIDIA), Apple Inc., Qualcomm | | webglRenderer | GPU model | ANGLE (NVIDIA, GeForce RTX 3060 Direct3D11), Apple M2 | | timezone | Geographic timezone | America/New_York, Europe/London, Asia/Tokyo | | locale / languages | Language preferences | en-US, ['en-US', 'en'] | | colorDepth | Display color depth | 24 | | pixelRatio | Device pixel ratio | 1.0, 1.25, 2.0, 3.0 | | maxTouchPoints | Touch capability | 0 (desktop), 5 (mobile) | | mobile | Device type | false (desktop), true (mobile) |

Desktop profiles (Windows, macOS, Linux) and mobile profiles (Samsung Galaxy, Google Pixel, OnePlus, Xiaomi, OPPO) are supported with matching GPU, screen, and user agent combinations.

// Let BBRE generate a fingerprint automatically
const session = new BBRESession({ apiKey: 'YOUR_API_KEY', mode: 'adaptive' });
await session.start();

// Access the generated profile
const profile = session.getProfile();
console.log(profile.userAgent);
console.log(profile.webglRenderer);
console.log(profile.timezone);

// Or get a compact summary
const summary = session.getProfileSummary();
// { userAgent, platform, screen: '1920x1080', deviceMemory: '16 GB', cpuCores: 8,
//   gpu: 'ANGLE (NVIDIA, GeForce RTX 3060...)', timezone: 'America/New_York',
//   locale: 'en-US', country: 'US', mobile: false }

// You can also provide custom fingerprint parameters
const response = await client.get('https://example.com', {
  fingerprint: {
    userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36',
    platform: 'MacIntel',
    timezone: 'Europe/London',
    screenResolution: '2560x1440'
  }
});

API Reference

BBREClient

The base client for direct HTTP requests, account management, and session creation.

Constructor

const client = new BBREClient({
  apiKey: 'YOUR_API_KEY',       // Required - your MyDisct Solver API key
  mode: 'passive',              // 'passive' | 'adaptive' (default: 'passive')
  sensibility: 'medium',        // 'low' | 'medium' | 'high' (default: 'medium')
  timeout: 120,                 // Request timeout in seconds (default: 120)
  pollingInterval: 2000,        // Async polling interval in ms (default: 2000)
  fingerprint: {},              // Default fingerprint configuration
  proxy: null                   // Default proxy configuration
});

HTTP Methods

All HTTP methods return a BBREResponse object with statusCode, headers, body, data, cookies, profile, and processingTime.

const res = await client.get(url, options);
const res = await client.post(url, body, options);
const res = await client.put(url, body, options);
const res = await client.delete(url, options);
const res = await client.patch(url, body, options);
const res = await client.head(url, options);
const res = await client.options(url, options);

Full Request with All Options

const response = await client.request({
  url: 'https://example.com/api/endpoint',
  method: 'POST',
  headers: { 'Accept': 'application/json', 'Authorization': 'Bearer token' },
  body: { key: 'value' },
  params: { page: '1', limit: '50' },
  mode: 'passive',
  sensibility: 'high',
  cookies: { session: 'abc123' },
  proxy: { protocol: 'http', host: '1.2.3.4', port: 8080, username: 'user', password: 'pass' },
  fingerprint: { userAgent: 'Custom UA', platform: 'Win32' },
  timeout: 60,
  sync: true,                    // true = synchronous, false = async with polling (default)
  allowRedirects: true,
  maxRedirects: 10,
  verify: true,
  auth: { username: 'user', password: 'pass' }
});

Response Object

{
  success: true,
  statusCode: 200,               // HTTP status code from target
  status: 200,                   // Alias for statusCode
  headers: { ... },              // Response headers
  body: '...',                   // Raw response body (string)
  data: { ... },                 // Parsed body (JSON if content-type is application/json)
  text: '...',                   // Alias for body
  content: '...',                // Alias for body
  cookies: { ... },              // Cookies set by the target
  profile: { ... },              // Browser fingerprint profile used
  processingTime: 2847,          // Processing time in ms
  json()                         // Method to parse body as JSON
}

Account Methods

const balance = await client.getBalance();
// Returns: number (e.g., 25.50)

const info = await client.getAccountInfo();
// Returns: {
//   account: { username, email, status, balance, createdAt },
//   statistics: { totalRequests, todayRequests, completedRequests, failedRequests, successRate, activeSessions }
// }

Session Management (from BBREClient)

const session = await client.createSession({
  mode: 'adaptive',
  sensibility: 'high',
  fingerprint: {},
  proxy: null,
  timeout: 300                   // Session timeout in seconds (max: 300)
});
// Returns: { success, sessionId, expiresAt, profile }

const status = await client.getSessionStatus(sessionId);
// Returns: { success, status, expiresAt, profile }

await client.closeSession(sessionId);
// Returns: { success }

Default Configuration

client.setDefaultMode('adaptive');
client.setDefaultSensibility('high');
client.setDefaultFingerprint({ platform: 'MacIntel', timezone: 'Europe/London' });
client.setDefaultProxy({ protocol: 'socks5', host: '1.2.3.4', port: 1080 });

BBRESession

Extends BBREClient with session lifecycle management, automatic cookie persistence, browser profile tracking, browser speed control, and the browser property for full browser automation.

Constructor & Lifecycle

const { BBRESession } = require('mydisctsolver-bbre');

const session = new BBRESession({
  apiKey: 'YOUR_API_KEY',
  mode: 'adaptive',
  sensibility: 'medium',
  browserSpeed: 'fast',          // 'instant' | 'fast' | 'human' (default: 'instant')
  force: false,                  // If true, errors don't auto-close the session (default: false)
  sessionTime: 2                 // Session duration in minutes, 0.5-5 range (default: 2)
});

await session.start();            // Creates session, allocates browser instance
console.log(session.isActive());  // true
console.log(session.getSessionId());

const status = await session.status();
// { success, status: 'active', expiresAt, profile }

await session.close();            // Closes session, frees resources

Session Requests (with automatic cookie persistence)

// All requests within a session automatically share and accumulate cookies
const res1 = await session.get('https://example.com/login-page');
// Cookies from res1 are stored in session

const res2 = await session.post('https://example.com/api/login', {
  username: 'user', password: 'pass'
});
// Cookies from res1 + res2 are merged and sent

const res3 = await session.get('https://example.com/dashboard');
// All accumulated cookies are sent automatically

Cookie Management

session.setCookie('custom_token', 'abc123');
session.getCookies();              // Returns all session cookies
session.deleteCookie('custom_token');
session.clearCookies();            // Clears all session cookies

Browser Profile

const profile = session.getProfile();
// Full profile: { userAgent, platform, screenWidth, screenHeight, deviceMemory,
//   hardwareConcurrency, webglVendor, webglRenderer, timezone, locale, ... }

const summary = session.getProfileSummary();
// Compact: { userAgent, platform, screen, deviceMemory, cpuCores, gpu, timezone, locale, country, mobile }

session.hasProfile();              // true if profile has been received

Browser Speed

Controls the speed of browser interactions. human mode adds realistic delays between actions.

session.setBrowserSpeed('human');  // 'instant' | 'fast' | 'human'
session.getBrowserSpeed();         // Returns current speed setting

BrowserAPI (session.browser)

Full browser automation interface. Accessible via session.browser after calling session.start().

Navigation

await session.browser.navigate('https://example.com', { waitUntil: 'load', timeout: 30 });
await session.browser.goto('https://example.com');    // Alias for navigate
await session.browser.reload();
await session.browser.back();
await session.browser.forward();

const currentUrl = await session.browser.getUrl();
const pageTitle = await session.browser.getTitle();

Element Interaction

await session.browser.click('#submit-btn');
await session.browser.click('#submit-btn', { delay: 0.5 });

await session.browser.fill('#email', '[email protected]');
await session.browser.type('#search', 'query text', { delay: 0.05 });
await session.browser.clear('#input-field');

await session.browser.select('#country', 'US');
await session.browser.checkbox('I agree to the terms and conditions');
await session.browser.checkbox({ text: 'Remember me', exact: false });

Form Operations

// Fill multiple fields at once
await session.browser.fillForm({
  '#first-name': 'John',
  '#last-name': 'Doe',
  '#email': '[email protected]',
  '#phone': '+1234567890'
}, { submit: true });  // Optionally submit the form after filling

Page Content & Element Search

const html = await session.browser.getHtml();
const text = await session.browser.getText('#price-display');
const title = await session.browser.getTitle();
const url = await session.browser.getUrl();

const found = await session.browser.find('#element-id');
const textFound = await session.browser.findByText('Add to Cart', { exact: true });

Waiting

await session.browser.wait(3);                                     // Wait 3 seconds

await session.browser.waitForSelector('.content-loaded', 30);      // Wait up to 30s for CSS selector
await session.browser.waitForText('Payment successful', 30);       // Wait up to 30s for text

// Advanced wait with full options
const result = await session.browser.waitForElement({
  selector: '#result-container',   // CSS selector to wait for
  text: null,                      // Or wait for specific text
  timeout: 30,                     // Max wait time in seconds
  pollInterval: 0.5,               // Check interval in seconds
  visible: true,                   // Element must be visible
  throwOnTimeout: false            // Don't throw, return { found: false } instead
});
// Returns: { found: boolean, elapsed: number, timedOut: boolean }

Scrolling

await session.browser.scrollDown(500);       // Scroll down 500px
await session.browser.scrollUp(300);         // Scroll up 300px
await session.browser.scrollToTop();
await session.browser.scrollToBottom();
await session.browser.scroll({ direction: 'down', amount: 1000 });
await session.browser.scroll({ x: 0, y: 500 });

Screenshots & JavaScript

const base64Image = await session.browser.screenshot({ fullPage: true });
const viewportShot = await session.browser.screenshot();

const result = await session.browser.execute('return document.title');
const data = await session.browser.evaluate('return JSON.stringify(window.__APP_STATE__)');

Browser Cookie Management

const cookies = await session.browser.getCookies();
await session.browser.setCookie('key', 'value', { domain: '.example.com', path: '/' });
await session.browser.clearCookies();

Batch Operations

Execute multi-step workflows in a single API call. Batch operations reduce network round-trips and improve performance for complex workflows.

submitForm - One-Call Form Submission

const result = await session.submitForm('https://example.com/register', {
  fields: {
    '#first-name': 'John',
    '#last-name': 'Doe',
    '#email': '[email protected]',
    '#password': 'securePass123'
  },
  select: { '#country': 'US', '#language': 'en' },
  checkbox: ['I agree to terms', 'Subscribe to newsletter'],
  submit: '#register-button',
  waitFor: 'Registration successful'
});

console.log(result.success);       // true
console.log(result.found);         // true (waitFor text was found)
console.log(result.finalUrl);      // Final URL after form submission
console.log(result.cookies);       // Cookies after submission

runSteps - Sequential Step Execution

const result = await session.runSteps('https://example.com/search', [
  { fill: { '#search-input': 'gaming laptops' } },
  { click: '#search-button' },
  { waitFor: { selector: '.search-results', timeout: 15 } },
  { scrollDown: 800 },
  { wait: 2 },
  { execute: 'return document.querySelectorAll(".product-card").length' }
]);

console.log(result.stepsCompleted);  // Number of steps completed
console.log(result.totalSteps);      // Total steps
console.log(result.results);         // Array of individual step results

interact - Action Sequence

const result = await session.interact('https://example.com/dashboard', {
  actions: [
    { click: '#menu-toggle' },
    { wait: 1 },
    { click: '#settings-link' },
    { waitFor: 'Account Settings' },
    { fill: { '#display-name': 'New Name' } },
    { click: '#save-settings' },
    { waitFor: 'Settings saved' }
  ]
});

checkPage - Quick Page Verification

const result = await session.checkPage('https://example.com/status', {
  check: 'All Systems Operational'
});

console.log(result.found);     // true if text was found on the page
console.log(result.finalUrl);  // Final URL (after any redirects)

Real-World Examples

Example 1: Hybrid Workflow - Login with Adaptive, Fetch with Passive

The most powerful pattern in BBRE. Use adaptive mode to handle the complex login flow (JavaScript forms, CSRF tokens, CAPTCHAs solved automatically), then switch to passive mode for high-speed data collection using the authenticated cookies. This approach is typically 3-4x faster and significantly cheaper than running everything in adaptive mode.

const BBREClient = require('mydisctsolver-bbre');
const { BBRESession } = require('mydisctsolver-bbre');

// Phase 1: Login with Adaptive Mode
// CAPTCHAs on the login page are solved automatically - no extra code needed
const session = new BBRESession({
  apiKey: 'YOUR_API_KEY',
  mode: 'adaptive',
  sensibility: 'high',
  browserSpeed: 'human'
});

await session.start();

await session.browser.navigate('https://portal.example.com/login');
await session.browser.waitForSelector('#login-form');
await session.browser.fill('#email', '[email protected]');
await session.browser.fill('#password', 'securePassword123');
await session.browser.click('#login-button');

// Just wait for the next page - any CAPTCHA is handled transparently
await session.browser.waitForText('Welcome back');

// Capture the authenticated cookies
const authCookies = await session.browser.getCookies();
console.log('Login successful, captured', Object.keys(authCookies).length, 'cookies');

// Close the adaptive session to free resources
await session.close();

// Phase 2: High-speed data collection with Passive Mode
const client = new BBREClient({
  apiKey: 'YOUR_API_KEY',
  mode: 'passive',
  sensibility: 'medium'
});

// Fetch multiple pages in parallel using the authenticated cookies
const pages = [1, 2, 3, 4, 5];
const results = await Promise.all(
  pages.map(page =>
    client.get(`https://portal.example.com/api/orders?page=${page}&limit=100`, {
      cookies: authCookies,
      headers: { 'Accept': 'application/json' }
    })
  )
);

results.forEach((res, i) => {
  const data = res.json();
  console.log(`Page ${pages[i]}: ${data.orders.length} orders fetched`);
});

Example 2: Login via Session Request, Then Browser Automation for Critical Operations

Use session-level HTTP requests to authenticate quickly, then switch to browser automation for operations that require visual interaction - like navigating admin panels, triggering exports, or interacting with JavaScript-heavy dashboards.

const { BBRESession } = require('mydisctsolver-bbre');

const session = new BBRESession({
  apiKey: 'YOUR_API_KEY',
  mode: 'adaptive',
  sensibility: 'high',
  browserSpeed: 'fast'
});

await session.start();

// Step 1: Login via session HTTP request (fast, no browser rendering needed)
const loginResponse = await session.post('https://app.example.com/api/auth/login', {
  email: '[email protected]',
  password: 'adminSecure456'
});

console.log('Login status:', loginResponse.statusCode);
console.log('Auth token received:', loginResponse.cookies.auth_token ? 'Yes' : 'No');
// Session cookies are automatically stored and will be used in all subsequent requests

// Step 2: Verify authentication via API
const profileResponse = await session.get('https://app.example.com/api/user/profile');
const profile = profileResponse.json();
console.log('Logged in as:', profile.name, '- Role:', profile.role);

// Step 3: Now switch to browser automation for critical operations
// that require JavaScript rendering and visual interaction
await session.browser.navigate('https://app.example.com/admin/reports');
await session.browser.waitForSelector('.report-dashboard');

// Generate a financial report through the UI
await session.browser.select('#report-type', 'financial-summary');
await session.browser.select('#date-range', 'Q4-2025');
await session.browser.select('#format', 'xlsx');
await session.browser.click('#generate-report');

// Wait for the report to be generated
await session.browser.waitForText('Report ready for download', 60);

// Extract the download URL from the page
const downloadUrl = await session.browser.execute(
  'return document.querySelector("#download-link").href'
);
console.log('Report download URL:', downloadUrl);

// Step 4: Download the report via session HTTP request (fast)
const reportData = await session.get(downloadUrl);
console.log('Report downloaded, size:', reportData.body.length, 'bytes');

// Step 5: Navigate to user management and perform bulk operations via browser
await session.browser.navigate('https://app.example.com/admin/users');
await session.browser.waitForSelector('.user-table');

// Select all inactive users and export
await session.browser.click('#filter-status');
await session.browser.click('[data-value="inactive"]');
await session.browser.waitForSelector('.filtered-results');
await session.browser.click('#select-all');
await session.browser.click('#export-selected');
await session.browser.waitForText('Export complete');

// Take a screenshot for audit trail
const screenshot = await session.browser.screenshot({ fullPage: true });
console.log('Audit screenshot captured');

await session.close();

Example 3: E-Commerce Account Checker with Automatic CAPTCHA Handling

Navigate a JavaScript-heavy e-commerce site, log in through CAPTCHA-protected pages, and extract account data. All CAPTCHAs are solved automatically - your code just waits for the next page.

const { BBRESession } = require('mydisctsolver-bbre');

async function checkAccount(email, password) {
  const session = new BBRESession({
    apiKey: 'YOUR_API_KEY',
    mode: 'adaptive',
    sensibility: 'high',
    browserSpeed: 'human',
    force: true  // Don't auto-close on errors
  });

  try {
    await session.start();

    // Navigate to login - Cloudflare/Akamai challenges are handled automatically
    await session.browser.navigate('https://shop.example.com/account/login');
    await session.browser.waitForSelector('#login-form');

    await session.browser.fill('#email', email);
    await session.browser.fill('#password', password);
    await session.browser.click('#sign-in-button');

    // Wait for either success or error - CAPTCHAs are solved transparently
    const result = await session.browser.waitForElement({
      text: 'My Account',
      timeout: 20,
      throwOnTimeout: false
    });

    if (!result.found) {
      return { success: false, reason: 'Login failed or timed out' };
    }

    // Extract account information
    await session.browser.navigate('https://shop.example.com/account/profile');
    await session.browser.waitForSelector('.profile-info');

    const name = await session.browser.getText('.profile-name');
    const balance = await session.browser.getText('.wallet-balance');
    const orderCount = await session.browser.getText('.order-count');

    // Take a screenshot for verification
    const screenshot = await session.browser.screenshot({ fullPage: true });

    return { success: true, name, balance, orderCount, screenshot };
  } finally {
    await session.close();
  }
}

const result = await checkAccount('[email protected]', 'password123');
console.log(result);

Example 4: Multi-Step Form Submission with Batch Actions

Submit a complex multi-page registration form in optimized batch calls.

const { BBRESession } = require('mydisctsolver-bbre');

const session = new BBRESession({
  apiKey: 'YOUR_API_KEY',
  mode: 'adaptive',
  sensibility: 'medium'
});

await session.start();

// Step 1: Submit registration form in one batch call
const regResult = await session.submitForm('https://example.com/register', {
  fields: {
    '#first-name': 'John',
    '#last-name': 'Doe',
    '#email': '[email protected]',
    '#password': 'SecurePass123!',
    '#confirm-password': 'SecurePass123!'
  },
  select: { '#country': 'US', '#timezone': 'America/New_York' },
  checkbox: 'I agree to the Terms of Service',
  submit: '#create-account',
  waitFor: 'Verify your email'
});

console.log('Registration:', regResult.found ? 'Success' : 'Failed');

// Step 2: Complete profile setup in another batch call
const profileResult = await session.runSteps('https://example.com/complete-profile', [
  { waitFor: { selector: '#profile-form', timeout: 10 } },
  { fill: { '#company': 'Acme Corp', '#phone': '+1-555-0123', '#bio': 'Software Engineer' } },
  { select: { '#industry': 'technology', '#team-size': '10-50' } },
  { click: '#save-profile' },
  { waitFor: 'Profile saved successfully' }
]);

console.log('Profile setup:', profileResult.found ? 'Complete' : 'Failed');
console.log('Steps completed:', profileResult.stepsCompleted, '/', profileResult.totalSteps);

await session.close();

Example 5: Progressive Enhancement - Passive First, Adaptive Fallback

Start with fast passive mode. If the response indicates JavaScript rendering is required (challenge page, empty body), automatically retry with adaptive mode. This minimizes cost while ensuring reliability.

const BBREClient = require('mydisctsolver-bbre');
const { BBRESession } = require('mydisctsolver-bbre');

const client = new BBREClient({ apiKey: 'YOUR_API_KEY' });

async function smartFetch(url) {
  // Try passive mode first (fast and cheap)
  const passiveResult = await client.get(url, {
    mode: 'passive',
    sensibility: 'medium'
  });

  // Check if the response looks like a JS challenge or empty content
  const body = passiveResult.body || '';
  const needsBrowser = (
    passiveResult.statusCode === 403 ||
    passiveResult.statusCode === 503 ||
    body.includes('challenge-platform') ||
    body.includes('Just a moment') ||
    body.length < 500
  );

  if (!needsBrowser) {
    console.log(`[PASSIVE] ${url} - ${passiveResult.statusCode}`);
    return passiveResult;
  }

  // Fallback to adaptive mode (full browser, CAPTCHAs solved automatically)
  console.log(`[ADAPTIVE] ${url} - retrying with browser`);

  const session = new BBRESession({
    apiKey: 'YOUR_API_KEY',
    mode: 'adaptive',
    sensibility: 'high'
  });

  await session.start();
  await session.browser.navigate(url);
  await session.browser.wait(3);  // Let challenges resolve automatically

  const html = await session.browser.getHtml();
  const cookies = await session.browser.getCookies();
  const finalUrl = await session.browser.getUrl();

  await session.close();

  return { statusCode: 200, body: html, cookies, finalUrl, mode: 'adaptive' };
}

const result = await smartFetch('https://protected-site.com/data');
console.log('Body length:', result.body.length);

Example 6: Session-Based Data Pipeline - Browser + HTTP Hybrid

Use a single session to combine browser automation for interactive steps with fast HTTP requests for data extraction. The session maintains cookies and state across both interaction types.

const { BBRESession } = require('mydisctsolver-bbre');

const session = new BBRESession({
  apiKey: 'YOUR_API_KEY',
  mode: 'adaptive',
  sensibility: 'high',
  browserSpeed: 'fast'
});

await session.start();

// Step 1: Login via browser (handles JS forms + CAPTCHAs automatically)
await session.browser.navigate('https://data-platform.example.com/login');
await session.browser.fill('#username', 'analyst');
await session.browser.fill('#password', 'securePass');
await session.browser.click('#login-btn');
await session.browser.waitForText('Dashboard');

// Step 2: Use browser to configure and trigger a report
await session.browser.navigate('https://data-platform.example.com/reports/generate');
await session.browser.waitForSelector('#report-form');
await session.browser.select('#report-type', 'monthly-sales');
await session.browser.select('#date-range', 'last-30-days');
await session.browser.select('#format', 'json');
await session.browser.click('#generate-report');
await session.browser.waitForText('Report ready', 60);

// Step 3: Switch to HTTP requests for fast data extraction
// Session cookies (including auth) are automatically included
const reportList = await session.get('https://data-platform.example.com/api/reports');
const reports = reportList.json();

for (const report of reports.data) {
  const detail = await session.get(
    `https://data-platform.example.com/api/reports/${report.id}`
  );
  console.log(`Report ${report.id}: ${detail.json().summary}`);
}

// Step 4: Back to browser for a screenshot
await session.browser.navigate('https://data-platform.example.com/dashboard');
await session.browser.waitForSelector('.dashboard-loaded');
const screenshot = await session.browser.screenshot({ fullPage: true });

await session.close();

Proxy Support

BBRE supports HTTP, HTTPS, SOCKS4, and SOCKS5 proxies with optional authentication.

// Set proxy globally
const client = new BBREClient({
  apiKey: 'YOUR_API_KEY',
  proxy: {
    protocol: 'http',        // 'http' | 'https' | 'socks4' | 'socks5'
    host: '123.45.67.89',
    port: 8080,
    username: 'proxyuser',   // Optional
    password: 'proxypass'    // Optional
  }
});

// Or per-request
const response = await client.get('https://example.com', {
  proxy: {
    protocol: 'socks5',
    host: '10.0.0.1',
    port: 1080
  }
});

// Remove proxy for a specific request
const directResponse = await client.get('https://example.com', {
  proxy: null
});

Cookie Formats

BBRE accepts cookies in three formats for maximum flexibility:

// Object format
await client.get('https://example.com', {
  cookies: { session_id: 'abc123', user_pref: 'dark_mode' }
});

// String format (standard cookie header)
await client.get('https://example.com', {
  cookies: 'session_id=abc123; user_pref=dark_mode'
});

// Array format (with domain/path metadata)
await client.get('https://example.com', {
  cookies: [
    { name: 'session_id', value: 'abc123', domain: '.example.com', path: '/' },
    { name: 'user_pref', value: 'dark_mode' }
  ]
});

TypeScript Support

Full TypeScript definitions are included out of the box. All classes, interfaces, and method signatures are typed.

import BBREClient, {
  BBRESession,
  BBREConfig,
  BBREResponse,
  RequestOptions,
  SessionOptions,
  BrowserProfile,
  ProfileSummary,
  ProxyConfig,
  Fingerprint
} from 'mydisctsolver-bbre';

const config: BBREConfig = {
  apiKey: 'YOUR_API_KEY',
  mode: 'passive',
  sensibility: 'medium'
};

const client = new BBREClient(config);

const response: BBREResponse = await client.get('https://example.com');
console.log(response.statusCode);
console.log(response.data);

const session = new BBRESession({ apiKey: 'YOUR_API_KEY', mode: 'adaptive' });
await session.start();
const profile: BrowserProfile | null = session.getProfile();
await session.close();

Supported CAPTCHA Types (Auto-Solved)

When BBRE encounters any of the following CAPTCHA types during a request, they are solved automatically. No additional code or configuration is required.

| Category | Types | |----------|-------| | reCAPTCHA | v2, v3, Enterprise | | hCaptcha | Standard, Enterprise, Image | | Cloudflare | Turnstile, Turnstile Managed, Challenge Page | | FunCaptcha | Token, Image (Arkose Labs) | | GeeTest | v3 Image, v4 Token/Image | | DataDome | Token, Image | | AWS | WAF Captcha Token, WAF Image | | TikTok | Image Puzzle | | Others | MTCaptcha, CaptchaFox, Friendly Captcha, Lemin, Tencent, FaucetPay, NetEase, Altcha, CyberSiAra, Prosopo, BLS, Temu, Binance, Shopee, Grid, Multi-Select, Click, Drag, Slide, Text, Rotate |


Documentation


Support & Community

Join our community for support, updates, and discussions!

Discord GitHub

Technical Support: [email protected] Website: solver.mydisct.com


License

MIT License - see LICENSE file for details


MyDisct Solver BBRE - Real browser requests, zero detection. The HTTP client that websites can't tell apart from a real user.

We are committed to building tools that empower developers and contribute to a freer, more open internet.