@hyperbrowser/sdk 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -50,6 +50,45 @@ status and truncation metadata before using output. Public types, including
|
|
|
50
50
|
See the [WebMCP guide](https://hyperbrowser.ai/docs/sessions/webmcp) for complete
|
|
51
51
|
examples, cancellation behavior, human submission, and limits.
|
|
52
52
|
|
|
53
|
+
## Web Bot Auth
|
|
54
|
+
|
|
55
|
+
A session can sign its requests with Web Bot Auth so websites can verify that they
|
|
56
|
+
come from Hyperbrowser. Web Bot Auth is enabled for teams on request.
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
const session = await client.sessions.create({ webBotAuth: true });
|
|
60
|
+
console.log(session.launchState?.webBotAuth?.signatureAgent); // "https://www.hyperbrowser.ai"
|
|
61
|
+
|
|
62
|
+
// Sign only requests to these hosts and their subdomains:
|
|
63
|
+
await client.sessions.create({ webBotAuth: { onlyDomains: ["example.com"] } });
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Agent tasks accept `webBotAuth` in `sessionOptions`; scrape, crawl, and extract
|
|
67
|
+
jobs do not. It cannot be combined with `useUltraStealth` or `startFromSnapshot`.
|
|
68
|
+
See the [Web Bot Auth guide](https://hyperbrowser.ai/docs/sessions/web-bot-auth).
|
|
69
|
+
|
|
70
|
+
## Proxy routes
|
|
71
|
+
|
|
72
|
+
`proxyRoutes` sends some hosts' traffic straight out instead of through the
|
|
73
|
+
session's proxy, or the other way round. The first route that matches a host
|
|
74
|
+
decides; hosts that no route matches use the proxy. Proxy routes require
|
|
75
|
+
`useProxy` and are enabled for teams on request.
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
const session = await client.sessions.create({
|
|
79
|
+
useProxy: true,
|
|
80
|
+
proxyRoutes: [
|
|
81
|
+
{ match: "api.example.com", proxy: "default" }, // stays on the proxy
|
|
82
|
+
{ match: ["*.example.com", "cdn.example.net"], proxy: "direct" },
|
|
83
|
+
],
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
A pattern is a hostname, `*.example.com` (its subdomains, not `example.com` itself),
|
|
88
|
+
or `*` (every host). Proxy routes only apply to `sessions.create` and cannot be
|
|
89
|
+
combined with `allowInternetAccess: false`, `allowOut`, or `denyOut`. See the
|
|
90
|
+
[proxy routes guide](https://hyperbrowser.ai/docs/sessions/proxy-routes).
|
|
91
|
+
|
|
53
92
|
## Usage
|
|
54
93
|
|
|
55
94
|
### Playwright
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GeminiComputerUseLlm, GeminiComputerUseTaskStatus } from "../constants";
|
|
1
|
+
import { GeminiComputerUseLlm, GeminiComputerUseReasoningEffort, GeminiComputerUseTaskStatus } from "../constants";
|
|
2
2
|
import { CreateSessionParams } from "../session";
|
|
3
3
|
export interface GeminiComputerUseApiKeys {
|
|
4
4
|
google?: string;
|
|
@@ -6,6 +6,7 @@ export interface GeminiComputerUseApiKeys {
|
|
|
6
6
|
export interface StartGeminiComputerUseTaskParams {
|
|
7
7
|
task: string;
|
|
8
8
|
llm?: GeminiComputerUseLlm;
|
|
9
|
+
reasoningEffort?: GeminiComputerUseReasoningEffort;
|
|
9
10
|
sessionId?: string;
|
|
10
11
|
maxFailures?: number;
|
|
11
12
|
maxSteps?: number;
|
|
@@ -26,7 +26,8 @@ export type CuaLlm = "computer-use-preview" | "gpt-6-astra" | "gpt-6.1-sol" | "g
|
|
|
26
26
|
export type CuaReasoningEffort = "none" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
27
27
|
export type HyperAgentVersion = "0.8.0" | "1.1.0";
|
|
28
28
|
export type HyperAgentLlm = "gpt-5.6-luna" | "gpt-5.5" | "gpt-5.2" | "gpt-5.1" | "gpt-5" | "gpt-5-mini" | "gpt-4o" | "gpt-4o-mini" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-nano" | "claude-sonnet-5" | "claude-sonnet-4-5" | "claude-sonnet-4-6" | "claude-haiku-5-5" | "gemini-2.5-flash" | "gemini-3.8-flash" | "gemini-3.7-flash" | "gemini-3-flash-preview";
|
|
29
|
-
export type GeminiComputerUseLlm = "gemini-3.8-flash" | "gemini-3.7-flash" | "gemini-3.6-flash" | "gemini-3.5-flash" | "gemini-3.5-flash-lite" | "gemini-3-flash-preview" | "gemini-2.5-computer-use-preview-10-2025";
|
|
29
|
+
export type GeminiComputerUseLlm = "gemini-4-argon" | "gemini-3.8-flash" | "gemini-3.7-flash" | "gemini-3.6-flash" | "gemini-3.5-flash" | "gemini-3.5-flash-lite" | "gemini-3-flash-preview" | "gemini-2.5-computer-use-preview-10-2025";
|
|
30
|
+
export type GeminiComputerUseReasoningEffort = "minimal" | "low" | "medium" | "high";
|
|
30
31
|
export type GrokComputerUseLlm = "grok-4.7" | "grok-4.6" | "grok-4.5";
|
|
31
32
|
export type GrokReasoningEffort = "low" | "medium" | "high";
|
|
32
33
|
export type MetaComputerUseLlm = "muse-spark-1.1" | "muse-spark-1.2" | "muse-spark-1.3" | "muse-wonder-1.0";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -11,13 +11,13 @@ export { StartGeminiComputerUseTaskParams, StartGeminiComputerUseTaskResponse, G
|
|
|
11
11
|
export { StartGrokComputerUseTaskParams, StartGrokComputerUseTaskResponse, GrokComputerUseTaskStatusResponse, GrokComputerUseTaskResponse, GrokComputerUseTaskData, GrokComputerUseStepResponse, GrokComputerUseApiKeys, GrokComputerUseTaskMetadata, } from "./agents/grok-computer-use";
|
|
12
12
|
export { StartMetaComputerUseTaskParams, StartMetaComputerUseTaskResponse, MetaComputerUseTaskStatusResponse, MetaComputerUseTaskResponse, MetaComputerUseTaskData, MetaComputerUseStepResponse, MetaComputerUseStepError, MetaComputerUseStepIncompleteDetails, MetaComputerUseStepReasoning, MetaComputerUseApiKeys, MetaComputerUseTaskMetadata, } from "./agents/meta-computer-use";
|
|
13
13
|
export { StartJevComputerUseTaskParams, StartJevComputerUseTaskResponse, JevComputerUseTaskStatusResponse, JevComputerUseTaskResponse, JevComputerUseTaskData, JevComputerUseStepResponse, JevComputerUseApiKeys, JevComputerUseTaskMetadata, } from "./agents/jev-computer-use";
|
|
14
|
-
export { BasicResponse, BrowserMemorySize, SessionStatus, Session, SessionDetail, SessionGetParams, SessionListParams, SessionListResponse, ScreenConfig, CaptchaEvaluationPageResult, CaptchaEvaluationParams, CaptchaEvaluationResponse, CaptchaEvaluationTarget, CaptchaEvaluationType, CaptchaSolverType, CreateSessionParams, CreateSessionSnapshotResponse, GetSessionDownloadsUrlResponse, GetSessionVideoRecordingUrlResponse, GetSessionRecordingUrlResponse, ImageCaptchaParam, UploadFileResponse, UploadFileOptions, GetActiveSessionsCountResponse, SessionEventLogListParams, SessionEventLogListResponse, SessionEventLog, SessionProfile, SessionLaunchState, SessionCreditBreakdown, StartSessionFromSnapshotParams, UpdateSessionProfileParams, UpdateSessionProxyLocationParams, UpdateSessionProxyParams, UpdateSessionScreenParams, UpdateSessionSolveCaptchasParams, UpdateSessionSolveCaptchasResponse, } from "./session";
|
|
14
|
+
export { BasicResponse, BrowserMemorySize, SessionStatus, Session, SessionDetail, SessionGetParams, SessionListParams, SessionListResponse, ScreenConfig, CaptchaEvaluationPageResult, CaptchaEvaluationParams, CaptchaEvaluationResponse, CaptchaEvaluationTarget, CaptchaEvaluationType, CaptchaSolverType, CreateSessionParams, CreateSessionSnapshotResponse, GetSessionDownloadsUrlResponse, GetSessionVideoRecordingUrlResponse, GetSessionRecordingUrlResponse, ImageCaptchaParam, UploadFileResponse, UploadFileOptions, GetActiveSessionsCountResponse, SessionEventLogListParams, SessionEventLogListResponse, SessionEventLog, SessionProfile, SessionLaunchState, SessionWebBotAuth, SessionCreditBreakdown, StartSessionFromSnapshotParams, WebBotAuthParams, ProxyRoute, UpdateSessionProfileParams, UpdateSessionProxyLocationParams, UpdateSessionProxyParams, UpdateSessionScreenParams, UpdateSessionSolveCaptchasParams, UpdateSessionSolveCaptchasResponse, } from "./session";
|
|
15
15
|
export { SandboxStatus, SandboxRuntimeTarget, SandboxNetworkPolicy, SandboxNetworkPolicyPatch, SandboxNetworkUpdateResult, Sandbox, SandboxDetail, SandboxVolumeMountType, SandboxVolumeMount, SandboxSecretReference, SandboxSecrets, SandboxResolvedSecret, SandboxListParams, SandboxListResponse, SandboxImageSource, SandboxImageSummary, SandboxImageListParams, SandboxImageListResponse, SandboxSnapshotStatus, SandboxSnapshotSummary, SandboxSnapshotListParams, SandboxSnapshotListResponse, SandboxSnapshotDeleteResult, SandboxImageDeleteResult, SandboxImageInit, SandboxImageBuildStatus, SandboxImageBuildInputFormat, SandboxImageBuildSourcePlatform, SandboxImageBuildUpload, SandboxImageBuild, SandboxBuildContextBundle, SandboxBuildContextMode, SandboxBuildContextManifest, SandboxDockerImageConfig, SandboxDockerImageLayer, SandboxDockerImageManifest, CreateSandboxImageBuildParams, ReuseSandboxDockerImageParams, CompleteSandboxImageBuildParams, SandboxImageBuildCreateResult, SandboxDockerImageReuseResult, SandboxImageBuildResolutionOutcome, SandboxImageBuildResolution, SandboxImageBuildWaitOptions, BuildSandboxImageFromDockerImageOptions, BuildSandboxImageFromDockerfileOptions, GetOrBuildSandboxImageOptions, SandboxImageBuildListParams, SandboxImageBuildListResponse, CreateSandboxParams, SandboxMemorySnapshotParams, SandboxMemorySnapshotResult, SandboxExposeParams, SandboxExposeResult, SandboxUnexposeResult, SandboxProcessStatus, SandboxExecParams, SandboxExecOptions, SandboxProcessSummary, SandboxProcessResult, SandboxProcessListParams, SandboxProcessListResponse, SandboxProcessWaitParams, SandboxProcessSignal, SandboxProcessStdinParams, SandboxProcessOutputEvent, SandboxProcessExitEvent, SandboxProcessStreamEvent, SandboxFileType, SandboxFileInfo, SandboxFileWriteInfo, SandboxFileListOptions, SandboxFileReadFormat, SandboxFileReadOptions, SandboxFileWriteData, SandboxFileWriteEntry, SandboxFileTextWriteOptions, SandboxFileBytesWriteOptions, SandboxFileMakeDirOptions, SandboxFileCopyParams, SandboxFileChmodParams, SandboxFileChownParams, SandboxFileTransferResult, SandboxFileSystemEventType, SandboxFileSystemEvent, SandboxWatchDirOptions, SandboxPresignFileParams, SandboxPresignedUrl, SandboxTerminalCreateParams, SandboxTerminalOutputChunk, SandboxTerminalStatus, SandboxTerminalWaitParams, SandboxTerminalKillParams, SandboxTerminalEvent, } from "./sandbox";
|
|
16
16
|
export { CreateVolumeParams, Volume, VolumeListParams, VolumeListResponse, VolumeDeleteResult, } from "./volume";
|
|
17
17
|
export { SecretValue, SecretsPublicKey, SecretsPublicKeyJwk, Secret, SecretVersion, SecretDetail, CreateSecretParams, UpdateSecretParams, SecretListParams, SecretListResponse, SecretDeleteResult, SecretVersionDeleteResult, } from "./secret";
|
|
18
18
|
export { CreateProfileParams, ForkProfileParams, ProfileResponse, CreateProfileResponse, ProfileListParams, ProfileListResponse, } from "./profile";
|
|
19
19
|
export { CreateExtensionParams, CreateExtensionResponse, ListExtensionsResponse, } from "./extension";
|
|
20
|
-
export { ExtractJobStatus, BrowserUseTaskStatus, BrowserUseLlm, ClaudeComputerUseLlm, ClaudeComputerUseReasoningEffort, CuaLlm, CuaReasoningEffort, GeminiComputerUseLlm, GrokComputerUseLlm, GrokReasoningEffort, MetaComputerUseLlm, MetaReasoningEffort, JevComputerUseLlm, JevTextLlm, ScrapeScreenshotFormat, ScrapeJobStatus, CrawlJobStatus, Country, State, ISO639_1, OperatingSystem, Platform, ScrapeFormat, ScrapeWaitUntil, ScrapePageStatus, CrawlPageStatus, RecordingStatus, DownloadsStatus, HyperAgentLlm, HyperAgentTaskStatus, ClaudeComputerUseTaskStatus, CuaTaskStatus, GeminiComputerUseTaskStatus, GrokComputerUseTaskStatus, MetaComputerUseTaskStatus, JevComputerUseTaskStatus, SessionEventLogType, SessionRegion, BrowserUseVersion, HyperAgentVersion, } from "./constants";
|
|
20
|
+
export { ExtractJobStatus, BrowserUseTaskStatus, BrowserUseLlm, ClaudeComputerUseLlm, ClaudeComputerUseReasoningEffort, CuaLlm, CuaReasoningEffort, GeminiComputerUseLlm, GeminiComputerUseReasoningEffort, GrokComputerUseLlm, GrokReasoningEffort, MetaComputerUseLlm, MetaReasoningEffort, JevComputerUseLlm, JevTextLlm, ScrapeScreenshotFormat, ScrapeJobStatus, CrawlJobStatus, Country, State, ISO639_1, OperatingSystem, Platform, ScrapeFormat, ScrapeWaitUntil, ScrapePageStatus, CrawlPageStatus, RecordingStatus, DownloadsStatus, HyperAgentLlm, HyperAgentTaskStatus, ClaudeComputerUseTaskStatus, CuaTaskStatus, GeminiComputerUseTaskStatus, GrokComputerUseTaskStatus, MetaComputerUseTaskStatus, JevComputerUseTaskStatus, SessionEventLogType, SessionRegion, BrowserUseVersion, HyperAgentVersion, } from "./constants";
|
|
21
21
|
export { TeamCreditInfo } from "./team";
|
|
22
22
|
export { ComputerAction, Coordinate, ClickActionParams, DragActionParams, PressKeysActionParams, MoveMouseActionParams, ScreenshotActionParams, CursorPositionActionParams, ScrollAtCursorActionParams, ScrollActionParams, TypeTextActionParams, ComputerActionParams, ComputerActionResponse, ComputerActionMouseButton, ComputerActionResponseData, HoldKeyActionParams, MouseDownActionParams, MouseUpActionParams, GetClipboardTextActionParams, PutSelectionTextActionParams, ComputerActionResponseDataClipboardText, ListWindowsActionParams, ComputerActionWindow, ComputerActionResponseDataListWindows, ComputerActionResponseDataCursorPosition, } from "./computer-action";
|
|
23
23
|
export { FetchParams, FetchResponse, FetchResponseData, FetchStatus } from "./web/fetch";
|
package/dist/types/session.d.ts
CHANGED
|
@@ -9,8 +9,17 @@ export interface SessionProfile {
|
|
|
9
9
|
id: string;
|
|
10
10
|
persistChanges?: boolean;
|
|
11
11
|
}
|
|
12
|
+
/** How a session signs its requests with Web Bot Auth. */
|
|
13
|
+
export interface SessionWebBotAuth {
|
|
14
|
+
/** The identity the session signs as, e.g. "https://www.hyperbrowser.ai". */
|
|
15
|
+
signatureAgent: string;
|
|
16
|
+
/** Present when signing is limited to these hostnames and their subdomains. */
|
|
17
|
+
onlyDomains?: string[];
|
|
18
|
+
}
|
|
12
19
|
export interface SessionLaunchState {
|
|
13
20
|
enableWebMcp?: boolean;
|
|
21
|
+
/** Present only for a session that signs its requests with Web Bot Auth. */
|
|
22
|
+
webBotAuth?: SessionWebBotAuth;
|
|
14
23
|
useUltraStealth?: boolean;
|
|
15
24
|
useStealth?: boolean;
|
|
16
25
|
useProxy?: boolean;
|
|
@@ -128,9 +137,44 @@ export interface CaptchaEvaluationResponse {
|
|
|
128
137
|
export interface StartSessionFromSnapshotParams {
|
|
129
138
|
snapshotId: string;
|
|
130
139
|
}
|
|
140
|
+
export interface WebBotAuthParams {
|
|
141
|
+
/**
|
|
142
|
+
* Sign only requests to these hostnames (e.g. "example.com") and their
|
|
143
|
+
* subdomains. No scheme, port or path; at most 50.
|
|
144
|
+
*/
|
|
145
|
+
onlyDomains?: string[];
|
|
146
|
+
}
|
|
147
|
+
export interface ProxyRoute {
|
|
148
|
+
/**
|
|
149
|
+
* The hosts this route applies to: a hostname, "*.example.com" (subdomains,
|
|
150
|
+
* not example.com itself) or "*" (every host), or a list of them.
|
|
151
|
+
*/
|
|
152
|
+
match: string | string[];
|
|
153
|
+
/**
|
|
154
|
+
* "direct" sends the traffic straight out of the browser's machine;
|
|
155
|
+
* "default" sends it through the session's proxy.
|
|
156
|
+
*/
|
|
157
|
+
proxy: "direct" | "default";
|
|
158
|
+
}
|
|
131
159
|
export interface CreateSessionParams {
|
|
132
160
|
/** Enable page-provided WebMCP tools. Defaults to false on the server. */
|
|
133
161
|
enableWebMcp?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Sign the session's requests with Web Bot Auth so websites can verify they
|
|
164
|
+
* come from Hyperbrowser. Pass `{ onlyDomains }` to sign only for those
|
|
165
|
+
* hosts. Requires Web Bot Auth to be enabled for your team; works for
|
|
166
|
+
* sessions and agent tasks, and cannot be combined with `useUltraStealth`
|
|
167
|
+
* or `startFromSnapshot`.
|
|
168
|
+
*/
|
|
169
|
+
webBotAuth?: boolean | WebBotAuthParams;
|
|
170
|
+
/**
|
|
171
|
+
* Choose, per host, whether the session's traffic goes through its proxy or
|
|
172
|
+
* straight out. The first route that matches a host decides; hosts that no
|
|
173
|
+
* route matches use the proxy. Requires `useProxy` and proxy routes to be
|
|
174
|
+
* enabled for your team, only applies when creating a session, and cannot
|
|
175
|
+
* be combined with `allowInternetAccess: false`, `allowOut` or `denyOut`.
|
|
176
|
+
*/
|
|
177
|
+
proxyRoutes?: ProxyRoute[];
|
|
134
178
|
useUltraStealth?: boolean;
|
|
135
179
|
useStealth?: boolean;
|
|
136
180
|
useProxy?: boolean;
|