Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.reader.dev/llms.txt

Use this file to discover all available pages before exploring further.

Browser Sessions

Browser sessions give you a full browser instance with anti-bot stealth active. Instead of getting back markdown, you get a CDP (Chrome DevTools Protocol) WebSocket URL that Playwright or Puppeteer can connect to.

When to Use Sessions

Use caseBest primitive
Extract content from a URLPOST /v1/read (scrape)
Discover pages on a sitePOST /v1/read (crawl)
Click buttons, fill forms, multi-step flowsSessions
Scrape behind login/auth wallsSessions
Take screenshots, generate PDFsSessions
Run existing Playwright scripts with stealthSessions

How It Works

  1. Create a session via POST /v1/sessions
  2. Connect Playwright/Puppeteer to the returned wsEndpoint
  3. Use normally - navigate, click, type, evaluate, screenshot
  4. Stop the session via DELETE /v1/sessions/:id
The browser has anti-bot stealth active: navigator.webdriver = false, navigator/WebGL spoofing, WebRTC masking. Your automation looks like a real user.

Quick Example

import { ReaderClient } from "@vakra-dev/reader-js";
import { chromium } from "playwright-core";

const reader = new ReaderClient({ apiKey: process.env.READER_API_KEY });

// One API call to create a stealthed browser
const session = await reader.sessions.create();

// One-line change from a local Playwright script
const browser = await chromium.connectOverCDP(session.wsEndpoint);
const page = (await browser.contexts())[0].pages()[0] || await (await browser.newContext()).newPage();

await page.goto("https://example.com");
console.log(await page.title());

// Cleanup
await browser.close();
await reader.sessions.stop(session.sessionId);

Stealth Features

Every session includes:
  • navigator.webdriver = false (the #1 bot detection signal)
  • Navigator property spoofing (deviceMemory, hardwareConcurrency, platform)
  • WebGL/Canvas fingerprint randomization
  • WebRTC IP leak prevention
  • Chrome plugin array simulation

Billing

Sessions are billed at 1 credit per minute. The timer starts on creation and stops when the session is closed or expires. Sessions auto-close after the configured timeout (default: 60 minutes max).

Supported Clients

ClientConnection method
Playwrightchromium.connectOverCDP(wsEndpoint)
Puppeteerconnect({ browserWSEndpoint: wsEndpoint })
Raw CDPWebSocket to wsEndpoint directly
Selenium via chromedriver is not supported (requires exclusive Chrome access).