@solarisdk/browserbase-compat 0.2.0 → 0.3.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0
4
+ - **Every Browserbase resource and method now exists.** `secrets`, `webhooks`, `navigationPolicies`, `certificates`, `functions.secrets`, `sessions.recording.downloads` and the rest were `undefined` on the client, so calling them failed with "not a function". They now throw `SolariCompatUnsupported` naming the method (for example `secrets.create`), as do `.asResponse()` / `.withResponse()` and the raw `client.get` / `post` / `request` calls. The ones that map to Solari (sessions, contexts, live view, recording) work as before.
5
+ - **`keepAlive` is reported correctly.** `sessions.retrieve` and `sessions.list` said `keepAlive: false` for every session. A session created with `keepAlive: true` now reports `true`. The gateway does not return it, so the package stores it in one reserved user metadata key, `solari_compat_keep_alive`, and hides that key from the `userMetadata` you get back. That key is reserved, and `keepAlive: true` with 50 metadata keys of your own now throws. A session created some other way, or by an older version, still reports `false`.
6
+ - **Behaviour change: the session timeout is `api_timeout`, as in Browserbase's SDK.** `api_timeout` is sent to Solari as the session length. A lone `sessions.create({ timeout: 300 })` used to set the session length; Browserbase's SDK treats it as the request timeout (milliseconds), and so does this package now. `timeout` next to other params (`create({ timeout: 300, keepAlive: true })`) is still read as the session length, and giving it together with a different `api_timeout` throws. Change `timeout` to `api_timeout`.
7
+ - **Options are no longer dropped.** The client takes `defaultHeaders` and `defaultQuery`. Every method takes Browserbase's second argument: `timeout`, `maxRetries`, `headers`, `query`, `signal` (an aborted request throws `APIUserAbortError`), and on create calls `body` and `idempotencyKey`. `httpAgent`, per-call `method` / `path` / `stream` and a header that sets `Authorization` throw.
8
+ - **Unknown keys throw instead of vanishing.** An unknown option on the client, an unknown key in the `sessions.create` params, in `context`, `viewport`, a proxy entry, its `geolocation` or `proxySettings`, in the query of `list` / `update` / `debug`, and `browserSettings.riskPolicyId` all throw `SolariCompatUnsupported`. **If a call now throws for such a key, it never had any effect: remove it or fix the spelling.**
9
+ - **`projectId` now warns once** (it was ignored silently). Solari keys belong to an organisation, so it selects nothing; `strict: true` throws instead.
10
+ - **`sessions.list` returns every session.** It stopped after the gateway's first page of 100; it now follows the pages to the end.
11
+ - **Wrong values removed.** `endedAt` was the time of your call for every finished session; it is now the expiry time for a timed-out session and absent for a released one (the gateway does not say when). `contexts.retrieve` of a missing context throws `NotFoundError`. `Context` gains `projectId` and `updatedAt`, and `ContextCreateResponse` gains `uploadUrl` (empty; see COMPAT.md).
12
+ - The replay and saved-context downloads go through the `fetch` you gave the client, and never carry your key or default headers.
13
+
14
+ ## 0.2.1
15
+ - **Security: the base URL check accepts only the Solari API hosts.** It used to accept any `*.getsolari.com` host, including sandbox preview hosts (`<label>-<port>.preview.getsolari.com`) that serve customer code, so a `baseURL` / `SOLARI_BASE_URL` pointed there would send your `slr_` key to code running in a sandbox. Now only the Solari API hosts and loopback are accepted.
16
+
3
17
  ## 0.2.0
4
18
  - `timeout`, `keepAlive` and `userMetadata` are sent to Solari (they were warned about and ignored in 0.1.0). `userMetadata` comes back on `create`, `retrieve` and `list`, and `sessions.list({ q })` filters on it.
5
19
  - **A base URL that does not point at Solari is now refused.** `baseURL` and `SOLARI_BASE_URL` must be `https` on `getsolari.com` (or a subdomain) or a loopback address; anything else throws `BrowserbaseError` ("Refusing to send a Solari API key to …"). In 0.1.0 such a URL was used as given, which could send your `slr_` key to another host.
package/COMPAT.md CHANGED
@@ -22,20 +22,22 @@ Keep it private: the session id inside it is the credential.
22
22
  | | |
23
23
  |---|---|
24
24
  | Key | `apiKey` option, else `SOLARI_API_KEY`, else `BROWSERBASE_API_KEY`. **A key that does not start with `slr_` is never used or sent** (it is probably a Browserbase secret): it is skipped with a warning that does not print it, and if no `slr_` key remains the constructor throws. |
25
- | Endpoint | `baseURL` option or `SOLARI_BASE_URL`; default `https://api.getsolari.com`. Must be `https` on `getsolari.com` (or a subdomain) or loopback, otherwise the constructor throws `BrowserbaseError` ("Refusing to send a Solari API key to …"): the key is never sent to another host. |
26
- | `projectId` | Accepted and ignored: Solari keys belong to an organisation, there are no projects. |
25
+ | Endpoint | `baseURL` option or `SOLARI_BASE_URL`; default `https://api.getsolari.com`. Must be `https` on a Solari API host or loopback (preview and other `*.getsolari.com` hosts are refused: they serve customer code), otherwise the constructor throws `BrowserbaseError` ("Refusing to send a Solari API key to …"): the key is never sent to another host. |
26
+ | `projectId` | Accepted, ignored, and **warned about once per client** (`strict: true` throws instead): Solari keys belong to an organisation, there are no projects. |
27
+ | Client options | `apiKey`, `baseURL`, `maxRetries` (default 2) and `timeout` (ms, default 60000) apply to every request. `defaultHeaders` and `defaultQuery` are added to every Solari request (never to presigned storage downloads); a `null` header value removes a header, and `Authorization` cannot be set. `fetch` replaces the global fetch (use it for a proxy or your own dispatcher). `maxRetries` and `timeout` read back. **`httpAgent` and any option this client does not have throw `SolariCompatUnsupported`** (they are never dropped). |
28
+ | Per-call options | Every method takes Browserbase's second argument: `timeout` (ms), `maxRetries`, `headers`, `query` and `signal` apply to every request the call makes (an aborted `signal` throws `APIUserAbortError`). `body` (extra JSON fields) and `idempotencyKey` apply to the create calls only (`sessions.create`, `contexts.create`); on any other call they throw. `method`, `path`, `stream`, `httpAgent`, `defaultBaseURL` and `__binary*` throw. `Authorization` cannot be set in `headers`. |
27
29
 
28
30
  ## Works
29
31
  | Browserbase | Here |
30
32
  |---|---|
31
33
  | `sessions.create` | `POST /sessions`; returns `connectUrl` (CDP), `id`, `status: "RUNNING"`, `expiresAt`, `region`, `keepAlive`, `contextId`. A create is retried safely (idempotency key). |
32
- | `sessions.retrieve`, `sessions.list({ status })` | Solari `active/released/expired/unknown` map to `RUNNING/COMPLETED/TIMED_OUT/ERROR`. `proxyBytes` is `0`, `startedAt` is the create time. |
34
+ | `sessions.retrieve`, `sessions.list({ status, q })` | Solari `active/released/expired/unknown` map to `RUNNING/COMPLETED/TIMED_OUT/ERROR`. `list` returns **every** matching session: it follows the gateway's pages to the end (it stops with a `BrowserbaseError` after 1000 pages, or if the gateway repeats a page cursor). See [Reported as unknown](#reported-as-unknown-or-empty) for the fields Solari does not have. |
33
35
  | `sessions.update(id, { status: "REQUEST_RELEASE" })` | Releases the session. |
34
36
  | `proxies: true`, `proxies: [{ type: "browserbase", geolocation }]` | A managed proxy; `geolocation.country/state/city` map across (a proxy needs the stealth browser, so `stealth` is switched on for you). `{ type: "none" }` means no proxy. |
35
37
  | `browserSettings.verified`, `advancedStealth` | Solari's stealth browser. |
36
38
  | `browserSettings.solveCaptchas: true` | Solari captcha solving (stealth browser, plan-gated). **Off unless you pass `true`**: Browserbase turns it on by default. |
37
39
  | `browserSettings.recordSession: true` | Session recording. **Off unless you pass `true`**: Browserbase records by default. Read it back with `sessions.recording.retrieve(id)` (rrweb events). |
38
- | `browserSettings.allowedDomains` | Egress allowlist (enterprise plan, stealth browser); a plan error comes back as an `APIError` with `code: "FeatureRequiresPlan"`. |
40
+ | `browserSettings.allowedDomains` | Egress allowlist (Team or Enterprise plan, stealth browser); a plan error comes back as an `APIError` with `code: "FeatureRequiresPlan"`. |
39
41
  | `browserSettings.context: { id, persist }`, `contexts.create/retrieve/delete` | A Context is a Solari **profile**. See [Contexts](#contexts). |
40
42
  | `sessions.debug(id, { expiresIn })` | A view-only live-view link (`debuggerUrl` and `debuggerFullscreenUrl` are the same link; `pages` is empty; `wsUrl` is the CDP URL). |
41
43
 
@@ -43,9 +45,25 @@ Keep it private: the session id inside it is the credential.
43
45
  - **Recording is a DOM-event log, not video.** `sessions.recording.retrieve(id)` returns rrweb events once the replay has been uploaded (a few seconds after release; until then it throws `APIError` with `code: "ReplayPending"`). There is no HLS playlist and no MP4.
44
46
  - **Contexts store cookies and localStorage only** (Playwright `storageState`), not IndexedDB, service workers or autofill data.
45
47
  - **No choice of operating system or viewport at create time (known gap).** A `viewport` setting is accepted with a one-line warning and has no effect; set the viewport from your automation client (`page.setViewportSize`). `strict: true` makes it throw instead.
46
- - **`timeout`, `keepAlive` and `userMetadata` work as in Browserbase.** `timeout` (seconds, at least 60) ends the session at that time, capped at your plan's maximum session length. `keepAlive: true` keeps the session after your client disconnects, until its `timeout` (default 1 hour), the plan maximum, or `sessions.update(..., REQUEST_RELEASE)`. `userMetadata` (up to 50 keys, 8 KB) is stored, returned by `retrieve`/`list`, and filterable with `sessions.list({ q: "user_metadata['key']:'value'" })` (conditions joined with `AND`).
48
+ - **`api_timeout`, `keepAlive` and `userMetadata` work as in Browserbase.** `api_timeout` (seconds, at least 60; Browserbase's name for the session timeout) ends the session at that time, capped at your plan's maximum session length. `keepAlive: true` keeps the session after your client disconnects, until its `api_timeout` (default 1 hour), the plan maximum, or `sessions.update(..., REQUEST_RELEASE)`. `userMetadata` (up to 50 keys, 8 KB) is stored, returned by `retrieve`/`list`, and filterable with `sessions.list({ q: "user_metadata['key']:'value'" })` (conditions joined with `AND`).
49
+ - **The session timeout is `api_timeout`; `timeout` is the request timeout.** As in Browserbase's SDK, a lone `sessions.create({ timeout: 5000 })` is the *options* argument (a request timeout in ms), not a session setting. The older spelling `timeout` (seconds) is still read as the session timeout when it sits next to other params (`create({ timeout: 300, keepAlive: true })`); passing it together with a different `api_timeout` throws. Use `api_timeout`.
50
+ - **`keepAlive` is remembered in the session's user metadata.** The Solari gateway does not return `keepAlive` when you retrieve or list a session. With `keepAlive: true`, `sessions.create` therefore also stores one reserved user metadata key, `solari_compat_keep_alive`, and `retrieve` / `list` read it back (and remove it from the `userMetadata` you see). Consequences: the key is reserved (using it yourself throws), `keepAlive: true` leaves room for 49 of your own metadata keys (50 throws), and **a session that was not created through this package (version 0.3.0 or later) reports `keepAlive: false` even if it was created with keep-alive**, because the gateway does not say.
47
51
  - **`viewport`, `blockAds: true`, `logSession: true`, `os`** are accepted with a one-line warning and have no effect. Pass `strict: true` to make them throw instead.
48
52
 
53
+ ## Reported as unknown or empty
54
+ Solari has no equivalent for these fields of Browserbase's objects, so they carry a fixed value instead of a made-up one:
55
+
56
+ | Field | Value |
57
+ |---|---|
58
+ | `Session.projectId`, `Context.projectId` | `""` (no projects) |
59
+ | `Session.updatedAt`, `Session.startedAt` | the create time |
60
+ | `Session.proxyBytes` | `0` |
61
+ | `Session.region` | `us-west-2` (Solari's single region) |
62
+ | `Session.endedAt` | the expiry time for a `TIMED_OUT` session; absent for a released one (the gateway does not say when), except in the answer to your own `sessions.update(..., REQUEST_RELEASE)`, where it is the time of that call |
63
+ | `Context.updatedAt` | the profile's last update when the gateway reports one, else its creation time |
64
+ | `ContextCreateResponse.publicKey`, `cipherAlgorithm`, `initializationVectorSize`, `uploadUrl` | `""` / `0` (Solari profiles are stored server-side, nothing is uploaded) |
65
+ | `SessionCreateResponse.seleniumRemoteUrl`, `signingKey` | `""` |
66
+
49
67
  ## Contexts
50
68
  ```ts
51
69
  const ctx = await bb.contexts.create({ name: "shop-login" });
@@ -62,4 +80,11 @@ const page = await (await b2.newContext({ storageState: s2.storageState })).newP
62
80
  Two differences from Browserbase: a saved context's **cookies** are also present in the default browser context (`browser.contexts()[0]`), but localStorage is applied only to a browser context created *with* the state (use `newContext({ storageState })` to get both), and `persist: true` saves when you release **through the same client object** (it is remembered in memory).
63
81
 
64
82
  ## Raises `SolariCompatUnsupported`
65
- Extensions (`extensionId`), the Selenium endpoint (`seleniumRemoteUrl` is always empty), downloads (`sessions.downloads`) and uploads (`sessions.uploads`) APIs, video replays (`sessions.replays`), session logs (`sessions.logs`), external/bring-your-own proxies, per-domain proxy rules (`domainPattern`), custom CA certificates, `ignoreCertificateErrors: true`, custom captcha selectors, `os: "mobile" | "tablet"`, a `region` other than `us-west-2` (or `us-west`), `contexts.update`, and the separate `projects`, `extensions`, `agents`, `fetchAPI` and `search` resources.
83
+ Every resource and method of Browserbase's Node SDK exists on the client; these throw, naming the method (for example `secrets.create`), and send nothing:
84
+
85
+ - **Resources Solari has no equivalent of:** `extensions` (and `extensionId`), `projects` (`retrieve`, `list`, `usage`), `agents` and `agents.runs`, `fetchAPI`, `search`, `secrets` (`create`, `retrieve`, `update`, `list`, `delete`, `getPublicKey`), `webhooks` (`create`, `retrieve`, `update`, `list`, `delete`, `rotateSecret`), `navigationPolicies`, `certificates`, `functions.secrets` (`list`, `attach`, `detach`).
86
+ - **Session sub-resources:** `sessions.downloads.list`, `sessions.uploads.create`, `sessions.logs.list`, `sessions.replays` (`retrieve`, `retrievePage`), `sessions.recording.downloads` (`create`, `list`). Recordings are DOM events: use `sessions.recording.retrieve`.
87
+ - **`contexts.update`.**
88
+ - **Raw responses and raw requests:** `.asResponse()` and `.withResponse()` on a returned promise; `client.get/post/put/patch/delete/getAPIList/request` (Browserbase API paths that Solari does not serve).
89
+ - **Settings:** the Selenium endpoint (`seleniumRemoteUrl` is always empty), external/bring-your-own proxies, per-domain proxy rules (`domainPattern`), custom CA certificates, `ignoreCertificateErrors: true`, custom captcha selectors, `riskPolicyId`, `os: "mobile" | "tablet"`, a `region` other than `us-west-2` (or `us-west`).
90
+ - **Any key Solari cannot map is refused, never dropped:** an unknown key in the `sessions.create` params, in `browserSettings`, in `context` (only `id`, `persist`), `viewport` (`width`, `height`), a `proxies` entry, its `geolocation` (`country`, `state`, `city`) or `proxySettings` (`caCertificates`); an unknown key in the query of `sessions.list` (`status`, `q`), `sessions.update` (`status`, `projectId`), `sessions.debug` (`expiresIn`) or `contexts.create` (`name`, `projectId`); an unknown client or per-call option.
package/README.md CHANGED
@@ -19,8 +19,9 @@ await browser.close();
19
19
  await bb.sessions.update(session.id, { status: "REQUEST_RELEASE" });
20
20
  ```
21
21
 
22
- Sessions, contexts, live view and recording are supported; extensions, downloads/uploads APIs, video replays,
23
- bring-your-own proxies and Selenium raise `SolariCompatUnsupported`. See [docs.getsolari.com/browserbase](https://docs.getsolari.com/browserbase) (and `COMPAT.md` in this package) for the full list
22
+ Sessions, contexts, live view and recording are supported. Every other Browserbase resource and method exists but throws
23
+ `SolariCompatUnsupported` naming it (extensions, secrets, webhooks, projects, downloads/uploads APIs, video replays,
24
+ bring-your-own proxies, Selenium, ...). See [docs.getsolari.com/browserbase](https://docs.getsolari.com/browserbase) (and `COMPAT.md` in this package) for the full list
24
25
  and every difference. Requires Node 20+. No Playwright version pin is needed: `connectUrl` is a plain CDP endpoint.
25
26
 
26
27
  Licence: MIT. See `NOTICE`.
package/dist/client.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { Call, CompatPromise, RequestOptions } from "./options.js";
1
2
  import type { Context, ContextCreateResponse, Session, SessionCreateParams, SessionCreateResponse, SessionLiveURLs, SessionRetrieveResponse, SessionStatus } from "./types.js";
2
3
  export declare const DEFAULT_BASE_URL = "https://api.getsolari.com";
3
4
  export interface BrowserbaseOptions {
@@ -9,76 +10,107 @@ export interface BrowserbaseOptions {
9
10
  strict?: boolean;
10
11
  /** Called for each soft difference; default console.warn. */
11
12
  onWarning?: (message: string) => void;
13
+ /** Retries for a request that failed with a connection error or 502/503/504 (GET, DELETE and creates only). Default 2. */
12
14
  maxRetries?: number;
13
- /** Per-request timeout in ms. */
15
+ /** Per-request timeout in ms. Default 60000. */
14
16
  timeout?: number;
15
- /** Test hook. */
17
+ /** A fetch to use instead of the global one (for a proxy, a custom dispatcher, or a test). */
16
18
  fetch?: typeof fetch;
19
+ /** Headers sent on every request. A `null` or `undefined` value removes a header. `Authorization` cannot be set. */
20
+ defaultHeaders?: Record<string, string | null | undefined>;
21
+ /** Query parameters sent on every request. */
22
+ defaultQuery?: Record<string, string | undefined>;
23
+ /** Not supported: raises. Pass `fetch` with your own dispatcher instead. */
24
+ httpAgent?: unknown;
17
25
  }
18
- /** Whether a base URL may receive a Solari key: https on getsolari.com or a subdomain, or loopback. */
26
+ /** Whether a base URL may receive a Solari key: https on a Solari API host, or loopback. */
19
27
  export declare function isSolariBaseUrl(raw: string): boolean;
20
28
  export declare class Browserbase {
21
29
  readonly sessions: Sessions;
22
30
  readonly contexts: Contexts;
23
- readonly extensions: UnsupportedResource;
24
- readonly projects: UnsupportedResource;
25
- readonly agents: UnsupportedResource;
26
- readonly fetchAPI: UnsupportedResource;
27
- readonly search: UnsupportedResource;
31
+ readonly extensions: import("./unsupported.js").UnsupportedMethods<"create" | "retrieve" | "delete">;
32
+ readonly projects: import("./unsupported.js").UnsupportedMethods<"retrieve" | "list" | "usage">;
33
+ readonly agents: {
34
+ runs: import("./unsupported.js").UnsupportedMethods<"create" | "retrieve" | "list" | "listMessages">;
35
+ create: (...args: unknown[]) => never;
36
+ retrieve: (...args: unknown[]) => never;
37
+ delete: (...args: unknown[]) => never;
38
+ list: (...args: unknown[]) => never;
39
+ update: (...args: unknown[]) => never;
40
+ };
41
+ readonly fetchAPI: import("./unsupported.js").UnsupportedMethods<"create">;
42
+ readonly search: import("./unsupported.js").UnsupportedMethods<"web">;
43
+ readonly certificates: import("./unsupported.js").UnsupportedMethods<"create" | "retrieve" | "delete" | "list">;
44
+ readonly secrets: import("./unsupported.js").UnsupportedMethods<"create" | "retrieve" | "delete" | "list" | "update" | "getPublicKey">;
45
+ readonly functions: {
46
+ secrets: import("./unsupported.js").UnsupportedMethods<"list" | "attach" | "detach">;
47
+ };
48
+ readonly webhooks: import("./unsupported.js").UnsupportedMethods<"create" | "retrieve" | "delete" | "list" | "update" | "rotateSecret">;
49
+ readonly navigationPolicies: import("./unsupported.js").UnsupportedMethods<"create" | "retrieve" | "delete" | "list" | "update">;
28
50
  readonly apiKey: string;
29
51
  readonly baseURL: string;
52
+ /** Retries for a failed request (client default; a call can override it). */
53
+ readonly maxRetries: number;
54
+ /** Request timeout in ms (client default; a call can override it). */
55
+ readonly timeout: number;
30
56
  /** @internal */ readonly strict: boolean;
31
57
  /** @internal */ readonly warn: (m: string) => void;
32
58
  private readonly fetchImpl;
33
- private readonly maxRetries;
34
- private readonly timeoutMs;
59
+ private readonly defaultHeaders;
60
+ private readonly defaultQuery;
61
+ private projectIdWarned;
35
62
  /** session id -> profile to save on release (browserSettings.context.persist). In-process only. */
36
63
  /** @internal */ readonly persist: Map<string, string>;
37
64
  constructor(opts?: BrowserbaseOptions);
38
- /** @internal GET a presigned URL (no Solari auth header). */
39
- fetchPublic(url: string): Promise<Response>;
65
+ get(..._a: unknown[]): never;
66
+ post(..._a: unknown[]): never;
67
+ put(..._a: unknown[]): never;
68
+ patch(..._a: unknown[]): never;
69
+ delete(..._a: unknown[]): never;
70
+ getAPIList(..._a: unknown[]): never;
71
+ request(..._a: unknown[]): never;
72
+ /** @internal `projectId` has nothing to select on Solari: say so once per client (or refuse under `strict`). */
73
+ noteProjectId(where: string): void;
74
+ /** @internal GET a presigned URL (no Solari auth header, no default headers). */
75
+ fetchPublic(url: string, call?: Call, defaultTimeoutMs?: number): Promise<Response>;
40
76
  /** @internal */
41
- request(method: string, path: string, body?: unknown, opts?: {
42
- idempotencyKey?: string;
43
- }): Promise<Response>;
77
+ send(method: string, path: string, body?: unknown, call?: Call): Promise<Response>;
44
78
  /** @internal */
45
- json<T>(method: string, path: string, body?: unknown, opts?: {
46
- idempotencyKey?: string;
47
- }): Promise<T>;
79
+ json<T>(method: string, path: string, body?: unknown, call?: Call): Promise<T>;
48
80
  }
49
- /** A resource whose every method throws SolariCompatUnsupported. */
50
- export type UnsupportedResource = {
51
- [method: string]: (...args: unknown[]) => never;
52
- };
53
81
  declare class Sessions {
54
82
  private readonly c;
55
83
  readonly recording: Recording;
56
- readonly replays: UnsupportedResource;
57
- readonly logs: UnsupportedResource;
58
- readonly downloads: UnsupportedResource;
59
- readonly uploads: UnsupportedResource;
84
+ readonly replays: import("./unsupported.js").UnsupportedMethods<"retrieve" | "retrievePage">;
85
+ readonly logs: import("./unsupported.js").UnsupportedMethods<"list">;
86
+ readonly downloads: import("./unsupported.js").UnsupportedMethods<"list">;
87
+ readonly uploads: import("./unsupported.js").UnsupportedMethods<"create">;
60
88
  constructor(c: Browserbase);
61
- create(params?: SessionCreateParams): Promise<SessionCreateResponse>;
62
- retrieve(id: string): Promise<SessionRetrieveResponse>;
89
+ create(params?: SessionCreateParams, options?: RequestOptions): CompatPromise<SessionCreateResponse>;
90
+ create(options?: RequestOptions): CompatPromise<SessionCreateResponse>;
91
+ retrieve(id: string, options?: RequestOptions): CompatPromise<SessionRetrieveResponse>;
63
92
  list(query?: {
64
93
  status?: SessionStatus;
65
94
  q?: string;
66
- }): Promise<Session[]>;
95
+ }, options?: RequestOptions): CompatPromise<Session[]>;
96
+ list(options?: RequestOptions): CompatPromise<Session[]>;
67
97
  /** `{ status: "REQUEST_RELEASE" }` releases the session (saving the context first when it was created with persist: true). */
68
98
  update(id: string, params: {
69
99
  status: "REQUEST_RELEASE";
70
100
  projectId?: string;
71
- }): Promise<Session>;
101
+ }, options?: RequestOptions): CompatPromise<Session>;
72
102
  /** Live-view links. Both URLs are the same view-only share link; `pages` is empty. */
73
103
  debug(id: string, query?: {
74
104
  expiresIn?: number;
75
- }): Promise<SessionLiveURLs>;
105
+ }, options?: RequestOptions): CompatPromise<SessionLiveURLs>;
106
+ debug(id: string, options?: RequestOptions): CompatPromise<SessionLiveURLs>;
76
107
  }
77
108
  declare class Recording {
78
109
  private readonly c;
110
+ readonly downloads: import("./unsupported.js").UnsupportedMethods<"create" | "list">;
79
111
  constructor(c: Browserbase);
80
112
  /** The session's DOM recording as an array of rrweb events. Needs `browserSettings: { recordSession: true }`; available a few seconds after release. */
81
- retrieve(id: string): Promise<unknown[]>;
113
+ retrieve(id: string, options?: RequestOptions): CompatPromise<unknown[]>;
82
114
  }
83
115
  declare class Contexts {
84
116
  private readonly c;
@@ -87,9 +119,10 @@ declare class Contexts {
87
119
  create(params?: {
88
120
  projectId?: string;
89
121
  name?: string;
90
- }): Promise<ContextCreateResponse>;
91
- retrieve(id: string): Promise<Context>;
92
- update(): never;
93
- delete(id: string): Promise<void>;
122
+ }, options?: RequestOptions): CompatPromise<ContextCreateResponse>;
123
+ create(options?: RequestOptions): CompatPromise<ContextCreateResponse>;
124
+ retrieve(id: string, options?: RequestOptions): CompatPromise<Context>;
125
+ update(..._a: unknown[]): never;
126
+ delete(id: string, options?: RequestOptions): CompatPromise<void>;
94
127
  }
95
128
  export {};