> ## Documentation Index
> Fetch the complete documentation index at: https://docs.julep.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Remote Browser

> Learn how to use the Remote Browser integration with Julep

## Overview

Welcome to the Remote Browser integration guide for Julep! This integration allows you to manage browser sessions and perform various actions, enabling you to build workflows that require browser automation capabilities.
Whether you're testing web applications or automating web tasks, this guide will walk you through the setup and usage.

## Prerequisites

<Info type="info" title="Setup Required">
  To use the Remote Browser integration, you need to configure a remote browser to connect to. The integration then uses Playwright for browser automation to interact with the that remote browser.
</Info>

## How to Use the Integration

To get started with the Remote Browser integration, follow these steps to configure and create a task:

<Steps>
  <Step title="Configure Remote Browser">
    Add your Remote Browser configuration (say Browserbase) to the tools section of your task. This will allow Julep to manage browser automation on your behalf to interact with the remote browser.
  </Step>

  <Step title="Create Task Definition">
    Use the following YAML configuration to perform browser actions in your task definition:

    ```yaml Remote Browser Example [expandable] theme={"dark"}
    name: Browser Automation Task
    tools:
    - name: browserbase_tool
      type: integration
      integration:
        provider: browserbase
        method: create_session
        setup:
          project_id: "BROWSERBASE_PROJECT_ID"

    - name: browser_tool
      type: integration
      integration:
        provider: remote_browser
        method: perform_action
        setup:
          width: 1920
          height: 1080

    main:

    - tool: browserbase_tool
      method: create_session
      arguments:
        project_id: BROWSERBASE_PROJECT_ID

    - evaluate:
        browser_session_id: $ _.id
        connect_url: $ _.connect_url

    - tool: browser_tool
      arguments:
        connect_url: $ _.connect_url
        action: navigate
        text: https://www.google.com
    ```
  </Step>
</Steps>

### YAML Explanation

<AccordionGroup>
  <Accordion title="Basic Configuration">
    * ***name***: A descriptive name for the task, in this case, "Browser Automation Task".
    * ***tools***: This section lists the tools or integrations being used. Here, `browser_tool` is defined as an integration tool.
  </Accordion>

  <Accordion title="Tool Configuration">
    * ***type***: Specifies the type of tool, which is `integration` in this context.
    * ***integration***: Details the provider and setup for the integration.
      * ***provider***: Indicates the service provider, which is `remote_browser`.
      * ***method***: Specifies the method to use, which is `perform_action`. Defaults to `perform_action` if not specified.
      * ***setup***: Contains configuration details, which are the connection url and the browser size (width and height).
  </Accordion>

  <Accordion title="Workflow Configuration">
    * ***main***: Defines the main execution steps.
      * ***tool***: Refers to the tool defined earlier (`browser_tool`).
      * ***method***: Specifies the method to use, which is `perform_action`.
      * ***arguments***: Specifies the input parameters for the tool:
        * ***action***: The type of action to perform.
            <Accordion title="List of Actions">
              - `key`: Send keyboard input
              - `type`: Type text into an input field
              - `mouse_move`: Move the mouse cursor to coordinates
              - `left_click`: Perform a left mouse click
              - `left_click_drag`: Click and drag with left mouse button
              - `right_click`: Perform a right mouse click
              - `middle_click`: Perform a middle mouse click
              - `double_click`: Perform a double click
              - `screenshot`: Take a screenshot
              - `cursor_position`: Get current cursor position
              - `navigate`: Navigate to a URL
              - `refresh`: Refresh the current page
            </Accordion>
        * ***text***: The text to type in the input field.
        * ***coordinate***: The coordinates to click on the screen to move the mouse.
  </Accordion>
</AccordionGroup>

<Note>
  * Remember to replace `BROWSERBASE_PROJECT_ID` with your actual project ID.
  * Make sure to properly configure browser settings and action parameters for your use case.
</Note>

## Conclusion

With the Remote Browser integration, you can efficiently automate browser interactions in your workflows. This integration provides a robust solution for web automation, enhancing your workflow's capabilities and reliability.

<Tip>
  For more information, please refer to the [Playwright documentation](https://playwright.dev/).
</Tip>
