browserbase

package
v0.41.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFlagOrEnvironmentVariable

func GetFlagOrEnvironmentVariable(cmd *cobra.Command, flagName string, environmentVariableName string) (string, error)

GetFlagOrEnvironmentVariable retrieves a value from either a command flag or an environment variable. It first checks the environment variable, then falls back to the command flag. Returns an error if neither source has a value.

Types

type BrowserSettings

type BrowserSettings struct {
	BlockAds      bool `json:"blockAds,omitempty"`
	SolveCaptchas bool `json:"solveCaptchas,omitempty"`
	RecordSession bool `json:"recordSession,omitempty"`
	LogSession    bool `json:"logSession,omitempty"`
}

type Client

type Client struct {
	APIKey        string
	URL           string
	ConnectionURL string
	ProjectID     string
	Sessions      []*Session
	Options       *common.BrowserbaseRequestConfig
}

func NewBrowserbaseClient

func NewBrowserbaseClient(browserbaseConfig *common.BrowserbaseRequestConfig, browserbaseSecrets *common.BrowserbaseRequestSecrets) *Client

func (*Client) CloseAllSessions

func (b *Client) CloseAllSessions(ctx context.Context) error

func (*Client) CloseSession

func (b *Client) CloseSession(ctx context.Context, sessionID string) error

func (*Client) ConnectionString

func (b *Client) ConnectionString(session Session) string

func (*Client) CreateSession

func (b *Client) CreateSession(ctx context.Context) (*Session, error)

type CloseSessionRequest

type CloseSessionRequest struct {
	ProjectID string `json:"projectId,omitempty"`
	Status    string `json:"status,omitempty"`
}

type CreateSessionRequest

type CreateSessionRequest struct {
	ProjectID       string          `json:"projectId,omitempty"`
	BrowserSettings BrowserSettings `json:"browserSettings,omitempty"`
	Proxies         []Proxy         `json:"proxies,omitempty"`
}

type Geolocation

type Geolocation struct {
	City    string `json:"city,omitempty"`
	State   string `json:"state,omitempty"`
	Country string `json:"country,omitempty"`
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithProxyCountries

func WithProxyCountries(countries []string) Option

type Options

type Options struct {
	Proxy     bool
	Countries []string
}

func NewBrowserbaseOptions

func NewBrowserbaseOptions(ctx context.Context, proxy bool, countries []string) *Options

type Proxy

type Proxy struct {
	Type        string       `json:"type"`
	Geolocation *Geolocation `json:"geolocation,omitempty"`
}

type ProxyCountryOption

type ProxyCountryOption struct {
	Countries []string
}

type Requester

type Requester struct {
	Client    Client
	Requester *headless.Requester
}

Requester is a struct that contains a Client and a Requester

func NewBrowserbaseRequester

func NewBrowserbaseRequester(
	ctx context.Context,
	browserbaseClient Client,
	timeout int,
	minDOMStabalizeTime int,
) *Requester

NewBrowserbaseRequester creates a new BrowserbaseRequester

func (*Requester) Close

func (b *Requester) Close(ctx context.Context) error

func (*Requester) SendRequest

func (*Requester) SendRequestWithMetadata added in v0.2.0

SendRequestWithMetadata performs a Browserbase-backed headless capture and preserves live DOM metadata collected by the underlying requester.

type Session

type Session struct {
	ID        string `json:"id,omitempty"`
	Status    string `json:"status,omitempty"`
	ContextID string `json:"contextId,omitempty"`
}

type WebSocket

type WebSocket struct {
	// contains filtered or unexported fields
}

func NewWebSocket

func NewWebSocket(ctx context.Context, url string) (*WebSocket, error)

func (*WebSocket) Read

func (w *WebSocket) Read() ([]byte, error)

func (*WebSocket) Send

func (w *WebSocket) Send(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL