{"modulePath":"github.com/Method-Security/webscan","version":"v0.42.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package browserbase\n\n## Functions\n\n```go\nfunc GetFlagOrEnvironmentVariable(cmd *cobra.Command, flagName string, environmentVariableName string) (string, error)\n```\nGetFlagOrEnvironmentVariable 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.\n\n## Types\n\n```go\ntype BrowserSettings struct {\n\tBlockAds      bool `json:\"blockAds,omitempty\"`\n\tSolveCaptchas bool `json:\"solveCaptchas,omitempty\"`\n\tRecordSession bool `json:\"recordSession,omitempty\"`\n\tLogSession    bool `json:\"logSession,omitempty\"`\n}\n```\n\n```go\ntype Client struct {\n\tAPIKey        string\n\tURL           string\n\tConnectionURL string\n\tProjectID     string\n\tSessions      []*Session\n\tOptions       *common.BrowserbaseRequestConfig\n}\n```\n\n```go\nfunc NewBrowserbaseClient(browserbaseConfig *common.BrowserbaseRequestConfig, browserbaseSecrets *common.BrowserbaseRequestSecrets) *Client\n```\n\n```go\nfunc (b *Client) CloseAllSessions(ctx context.Context) error\n```\n\n```go\nfunc (b *Client) CloseSession(ctx context.Context, sessionID string) error\n```\n\n```go\nfunc (b *Client) ConnectionString(session Session) string\n```\n\n```go\nfunc (b *Client) CreateSession(ctx context.Context) (*Session, error)\n```\n\n```go\ntype CloseSessionRequest struct {\n\tProjectID string `json:\"projectId,omitempty\"`\n\tStatus    string `json:\"status,omitempty\"`\n}\n```\n\n```go\ntype CreateSessionRequest struct {\n\tProjectID       string          `json:\"projectId,omitempty\"`\n\tBrowserSettings BrowserSettings `json:\"browserSettings,omitempty\"`\n\tProxies         []Proxy         `json:\"proxies,omitempty\"`\n}\n```\n\n```go\ntype Geolocation struct {\n\tCity    string `json:\"city,omitempty\"`\n\tState   string `json:\"state,omitempty\"`\n\tCountry string `json:\"country,omitempty\"`\n}\n```\n\n```go\ntype Option interface {\n\t// contains filtered or unexported methods\n}\n```\n\n```go\nfunc WithProxyCountries(countries []string) Option\n```\n\n```go\ntype Options struct {\n\tProxy     bool\n\tCountries []string\n}\n```\n\n```go\nfunc NewBrowserbaseOptions(ctx context.Context, proxy bool, countries []string) *Options\n```\n\n```go\ntype Proxy struct {\n\tType        string       `json:\"type\"`\n\tGeolocation *Geolocation `json:\"geolocation,omitempty\"`\n}\n```\n\n```go\ntype ProxyCountryOption struct {\n\tCountries []string\n}\n```\n\n```go\ntype Requester struct {\n\tClient    Client\n\tRequester *headless.Requester\n}\n```\nRequester is a struct that contains a Client and a Requester\n\n```go\nfunc NewBrowserbaseRequester(\n\tctx context.Context,\n\tbrowserbaseClient Client,\n\ttimeout int,\n\tminDOMStabalizeTime int,\n) *Requester\n```\nNewBrowserbaseRequester creates a new BrowserbaseRequester\n\n```go\nfunc (b *Requester) Close(ctx context.Context) error\n```\n\n```go\nfunc (b *Requester) SendRequest(ctx context.Context, options common.SendHttpRequestConfig) (common.HttpRequestResponse, error)\n```\n\n```go\nfunc (b *Requester) SendRequestWithMetadata(ctx context.Context, options common.SendHttpRequestConfig) (common.HttpRequestResponse, headless.PageMetadata, error)\n```\nSendRequestWithMetadata performs a Browserbase-backed headless capture and preserves live DOM metadata collected by the underlying requester.\n\n```go\ntype Session struct {\n\tID        string `json:\"id,omitempty\"`\n\tStatus    string `json:\"status,omitempty\"`\n\tContextID string `json:\"contextId,omitempty\"`\n}\n```\n\n```go\ntype WebSocket struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewWebSocket(ctx context.Context, url string) (*WebSocket, error)\n```\n\n```go\nfunc (w *WebSocket) Read() ([]byte, error)\n```\n\n```go\nfunc (w *WebSocket) Send(b []byte) error\n```\n\n","path":"github.com/Method-Security/webscan/utils/request/headless/browserbase","name":"browserbase","synopsis":"","isRedistributable":true}
