# Start Browser — Anchor Browser

> Allocates a new browser session for the user, with optional configurations for ad-blocking, captcha solving, proxy usage, and idle timeout. See the documentation.

- Key: `anchor_browser-start-browser`
- Type: Action (Write)
- Version: 0.0.2
- App: Anchor Browser (`anchor_browser`) — https://pipedream.com/apps/anchor-browser.md
- This page (HTML): https://pipedream.com/apps/anchor-browser/actions/start-browser
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/anchor_browser/actions/start-browser/start-browser.mjs

## Description

Allocates a new browser session for the user, with optional configurations for ad-blocking, captcha solving, proxy usage, and idle timeout. [See the documentation](https://docs.anchorbrowser.io/api-reference/browser-sessions/start-browser).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `adblockConfigActive` | `boolean` | Yes | Whether adblock configuration is active |
| `adblockConfigPopupBlockingActive` | `boolean` | Yes | Whether popup blocking is active |
| `captchaConfigActive` | `boolean` | Yes | Whether captcha configuration is active |
| `headless` | `boolean` | Yes | Whether browser should be headless or headfull. |
| `proxyConfigType` | `string` | No | The type of proxy configuration to use. Eg. anchor_residential. |
| `proxyConfigActive` | `boolean` | No | Whether proxy configuration is active |
| `recordingActive` | `boolean` | No | Whether recording is active |
| `profileName` | `string` | Yes | The name of the profile to use for the browser session. Options are loaded from the connected account. |
| `profilePersist` | `boolean` | Yes | Whether the profile should persist after the session ends. |
| `viewportWidth` | `integer` | Yes | The width of the viewport |
| `viewportHeight` | `integer` | Yes | The height of the viewport |
| `timeout` | `string` | No | Maximum amount of time (in minutes) for the browser to run, before terminating. Defaults to -1, which disables the global timeout mechanism. |
| `idleTimeout` | `string` | No | The amount of time (in minutes) the session waits for new connections after all others are closed before stopping. Defaults to 1. Setting it to -1 let the browser session continue forever [CAUTION - Keep track of long living sessions and manually kill them]. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "anchor_browser",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "anchor_browser-start-browser",
  arguments: {
    adblockConfigActive: true,
    adblockConfigPopupBlockingActive: true,
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "anchor_browser-start-browser",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    anchor_browser: { authProvisionId: "apn_xxxxxxx" },
    adblockConfigActive: true,
    adblockConfigPopupBlockingActive: true,
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "anchor_browser-start-browser",
    "configured_props": {
      "anchor_browser": { "authProvisionId": "apn_xxxxxxx" },
      "adblockConfigActive": true,
      "adblockConfigPopupBlockingActive": true
    }
  }'
```

---

- App: https://pipedream.com/apps/anchor-browser.md · All apps: https://pipedream.com/apps
