Skip to main content

Quickstart

Get a managed stealth browser running in minutes.

1. Install

brew tap meshbrow-dev/tap
brew install meshbrow
Verify the installation:
meshbrow version
# meshbrow v0.1.0 (darwin/arm64)

2. Authenticate

Sign up at meshbrow.dev to get your API key.
meshbrow auth login --key mb_live_your_key_here
Alternatively, set the MESHBROW_API_KEY environment variable — useful in CI/CD.
export MESHBROW_API_KEY=mb_live_your_key_here

3. Launch a Session

meshbrow sessions create --proxy residential --country US --stealth max
# ✓ Session created: sess_abc123
#   CDP URL: wss://api.meshbrow.dev/cdp/sess_abc123?token=...
#   Proxy:   US residential
#   Stealth: max

4. Connect with Playwright

import { chromium } from 'playwright';

const browser = await chromium.connectOverCDP(session.cdpUrl);
const context = browser.contexts()[0];
const page = context.pages()[0];

// Browse as a real user
await page.goto('https://nowsecure.nl');
await page.waitForTimeout(3000);

// Take a screenshot
await page.screenshot({ path: 'result.png' });
console.log('Anti-detect test passed!');
Or via CLI:
meshbrow actions navigate --session sess_abc123 --url https://nowsecure.nl
meshbrow actions screenshot --session sess_abc123 --output result.png

5. Destroy the Session

meshbrow sessions destroy sess_abc123

Full Example

Here’s the complete script with the TypeScript SDK:
import { Meshbrow } from '@meshbrow/sdk';
import { chromium } from 'playwright';

async function main() {
  const client = new Meshbrow({ apiKey: process.env.MESHBROW_API_KEY! });

  // Launch session
  const session = await client.sessions.create({
    proxy: { type: 'residential', country: 'US' },
    stealth: 'max',
  });

  try {
    // Connect Playwright
    const browser = await chromium.connectOverCDP(session.cdpUrl);
    const page = browser.contexts()[0].pages()[0];

    // Navigate and extract data
    await page.goto('https://example.com');
    const title = await page.title();
    console.log(`Page title: ${title}`);

    // Capture HAR
    await page.context().tracing.start({ screenshots: true });
    await page.goto('https://httpbin.org/ip');
    await page.context().tracing.stop({ path: 'trace.zip' });

  } finally {
    // Always clean up
    await client.sessions.destroy(session.id);
  }
}

main();

Using the REST API Directly

If you prefer raw HTTP:
# Create a session
curl -X POST https://api.meshbrow.dev/v1/sessions \
  -H "Authorization: Bearer mb_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "proxy": { "type": "residential", "country": "US" },
    "stealth": "max"
  }'

# Response:
# { "id": "sess_abc123", "cdpUrl": "wss://api.meshbrow.dev/cdp/sess_abc123?token=..." }

# Destroy when done
curl -X DELETE https://api.meshbrow.dev/v1/sessions/sess_abc123 \
  -H "Authorization: Bearer mb_live_..."

Next Steps