Skip to content

Start Browser Session

bedrockagentcore_start_browser_session R Documentation

Creates and initializes a browser session in Amazon Bedrock AgentCore

Description

Creates and initializes a browser session in Amazon Bedrock AgentCore. The session enables agents to navigate and interact with web content, extract information from websites, and perform web-based tasks as part of their response generation.

To create a session, you must specify a browser identifier and a name. You can also configure the viewport dimensions to control the visible area of web content. The session remains active until it times out or you explicitly stop it using the stop_browser_session operation.

The following operations are related to start_browser_session:

  • get_browser_session

  • update_browser_stream

  • save_browser_session_profile

  • stop_browser_session

  • invoke_browser

Usage

bedrockagentcore_start_browser_session(traceId, traceParent,
  browserIdentifier, name, sessionTimeoutSeconds, viewPort, extensions,
  profileConfiguration, proxyConfiguration, enterprisePolicies,
  certificates, clientToken)

Arguments

traceId

The trace identifier for request tracking.

traceParent

The parent trace information for distributed tracing.

browserIdentifier

[required] The unique identifier of the browser to use for this session. This identifier specifies which browser environment to initialize for the session.

name

The name of the browser session. This name helps you identify and manage the session. The name does not need to be unique.

sessionTimeoutSeconds

The duration in seconds (time-to-live) after which the session automatically terminates, regardless of ongoing activity. Defaults to 3600 seconds (1 hour). Recommended minimum: 60 seconds. Maximum allowed: 28,800 seconds (8 hours).

viewPort

The dimensions of the browser viewport for this session. This determines the visible area of the web content and affects how web pages are rendered. If not specified, Amazon Bedrock AgentCore uses a default viewport size.

extensions

A list of browser extensions to load into the browser session.

profileConfiguration

The browser profile configuration to use for this session. A browser profile contains persistent data such as cookies and local storage that can be reused across multiple browser sessions. If specified, the session initializes with the profile's stored data, enabling continuity for tasks that require authentication or personalized settings.

proxyConfiguration

Optional proxy configuration for routing browser traffic through customer-specified proxy servers. When provided, enables HTTP Basic authentication via Amazon Web Services Secrets Manager and domain-based routing rules. Requires secretsmanager:GetSecretValue IAM permission for the specified secret ARNs.

enterprisePolicies

A list of files containing enterprise policies for the browser.

certificates

A list of certificates to install in the browser session.

clientToken

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock AgentCore ignores the request, but does not return an error. This parameter helps prevent the creation of duplicate sessions if there are temporary network issues.

Value

A list with the following syntax:

list(
  browserIdentifier = "string",
  sessionId = "string",
  createdAt = as.POSIXct(
    "2015-01-01"
  ),
  streams = list(
    automationStream = list(
      streamEndpoint = "string",
      streamStatus = "ENABLED"|"DISABLED"
    ),
    liveViewStream = list(
      streamEndpoint = "string"
    )
  )
)

Request syntax

svc$start_browser_session(
  traceId = "string",
  traceParent = "string",
  browserIdentifier = "string",
  name = "string",
  sessionTimeoutSeconds = 123,
  viewPort = list(
    width = 123,
    height = 123
  ),
  extensions = list(
    list(
      location = list(
        s3 = list(
          bucket = "string",
          prefix = "string",
          versionId = "string"
        )
      )
    )
  ),
  profileConfiguration = list(
    profileIdentifier = "string"
  ),
  proxyConfiguration = list(
    proxies = list(
      list(
        externalProxy = list(
          server = "string",
          port = 123,
          domainPatterns = list(
            "string"
          ),
          credentials = list(
            basicAuth = list(
              secretArn = "string"
            )
          )
        )
      )
    ),
    bypass = list(
      domainPatterns = list(
        "string"
      )
    )
  ),
  enterprisePolicies = list(
    list(
      location = list(
        s3 = list(
          bucket = "string",
          prefix = "string",
          versionId = "string"
        )
      ),
      type = "MANAGED"|"RECOMMENDED"
    )
  ),
  certificates = list(
    list(
      location = list(
        secretsManager = list(
          secretArn = "string"
        )
      )
    )
  ),
  clientToken = "string"
)