Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.anchorbrowser.io/llms.txt

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

Ad blocking is enabled by default in Anchor Browser. It blocks ads, trackers, and malicious content to improve page load times and create cleaner automation.
Ad blocking is enabled by default. Disable it only if you need to test ad-related functionality.

Quick Start

import AnchorBrowser from 'anchorbrowser';

(async () => {
  const anchorClient = new AnchorBrowser({apiKey: process.env.ANCHOR_API_KEY});
  
  const session = await anchorClient.sessions.create({
    // Optional: ad blocking is enabled by default, so this configuration is not required
    browser: {
      adblock: {
        active: true  // Set to false to disable ad blocking
      }
    }
  });
  
  console.log("Session:", session.data.id);
})().catch(console.error);

Disabling Ad Blocker

To disable ad blocking for a session, set active: false in the adblock configuration:
import AnchorBrowser from 'anchorbrowser';

(async () => {
  const anchorClient = new AnchorBrowser({apiKey: process.env.ANCHOR_API_KEY});
  
  const session = await anchorClient.sessions.create({
    browser: {
      adblock: {
        active: false  // Disables ad blocking for this session
      }
    }
  });
  
  console.log("Session:", session.data.id);
})().catch(console.error);