Skip to content

Commit 3df1a94

Browse files
feat(api): api update
1 parent 61a0d0f commit 3df1a94

File tree

14 files changed

+936
-263
lines changed

14 files changed

+936
-263
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 22
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browser-use%2Fbrowser-use-86040fd18419e7b4e0947660d9c0ff1abe21550528d2d2a549736cd16f85a92d.yml
3-
openapi_spec_hash: 7c5de9d0f633db35fd9e250fcc834d1f
1+
configured_endpoints: 21
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browser-use%2Fbrowser-use-9ff5409663c58ae9e3ecc9ac764956189e3a70600f5ba1b961bb1dedf0208271.yml
3+
openapi_spec_hash: 9865acb75430d9b799502acbae860df0
44
config_hash: 99e0e445bc20c5723030c315bab52940

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ The full API of this library can be found in [api.md](api.md).
2222
```js
2323
import BrowserUse from 'browser-use-sdk';
2424

25-
const client = new BrowserUse({
26-
apiKey: process.env['BROWSER_USE_API_KEY'], // This is the default and can be omitted
27-
});
25+
const client = new BrowserUse();
2826

2927
const tasks = await client.tasks.list();
3028

@@ -39,9 +37,7 @@ This library includes TypeScript definitions for all request params and response
3937
```ts
4038
import BrowserUse from 'browser-use-sdk';
4139

42-
const client = new BrowserUse({
43-
apiKey: process.env['BROWSER_USE_API_KEY'], // This is the default and can be omitted
44-
});
40+
const client = new BrowserUse();
4541

4642
const tasks: BrowserUse.TaskListResponse = await client.tasks.list();
4743
```
@@ -92,6 +88,7 @@ You can use the `maxRetries` option to configure or disable this:
9288
```js
9389
// Configure the default for all requests:
9490
const client = new BrowserUse({
91+
apiKey: 'My API Key',
9592
maxRetries: 0, // default is 2
9693
});
9794

@@ -109,6 +106,7 @@ Requests time out after 1 minute by default. You can configure this with a `time
109106
```ts
110107
// Configure the default for all requests:
111108
const client = new BrowserUse({
109+
apiKey: 'My API Key',
112110
timeout: 20 * 1000, // 20 seconds (default is 1 minute)
113111
});
114112

api.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,16 @@ Types:
55
- <code><a href="./src/resources/tasks.ts">LlmModel</a></code>
66
- <code><a href="./src/resources/tasks.ts">TaskStatus</a></code>
77
- <code><a href="./src/resources/tasks.ts">TaskView</a></code>
8-
- <code><a href="./src/resources/tasks.ts">TaskRetrieveResponse</a></code>
98
- <code><a href="./src/resources/tasks.ts">TaskListResponse</a></code>
109
- <code><a href="./src/resources/tasks.ts">TaskRetrieveLogsResponse</a></code>
11-
- <code><a href="./src/resources/tasks.ts">TaskRetrieveOutputFileResponse</a></code>
1210

1311
Methods:
1412

1513
- <code title="post /tasks">client.tasks.<a href="./src/resources/tasks.ts">create</a>({ ...params }) -> TaskView</code>
16-
- <code title="get /tasks/{task_id}">client.tasks.<a href="./src/resources/tasks.ts">retrieve</a>(taskID, { ...params }) -> TaskRetrieveResponse</code>
14+
- <code title="get /tasks/{task_id}">client.tasks.<a href="./src/resources/tasks.ts">retrieve</a>(taskID) -> TaskView</code>
1715
- <code title="patch /tasks/{task_id}">client.tasks.<a href="./src/resources/tasks.ts">update</a>(taskID, { ...params }) -> TaskView</code>
1816
- <code title="get /tasks">client.tasks.<a href="./src/resources/tasks.ts">list</a>({ ...params }) -> TaskListResponse</code>
1917
- <code title="get /tasks/{task_id}/logs">client.tasks.<a href="./src/resources/tasks.ts">retrieveLogs</a>(taskID) -> TaskRetrieveLogsResponse</code>
20-
- <code title="get /tasks/{task_id}/output-files/{file_name}">client.tasks.<a href="./src/resources/tasks.ts">retrieveOutputFile</a>(fileName, { ...params }) -> TaskRetrieveOutputFileResponse</code>
2118

2219
# Sessions
2320

@@ -38,13 +35,12 @@ Methods:
3835
Types:
3936

4037
- <code><a href="./src/resources/sessions/public-share.ts">ShareView</a></code>
41-
- <code><a href="./src/resources/sessions/public-share.ts">PublicShareDeleteResponse</a></code>
4238

4339
Methods:
4440

4541
- <code title="post /sessions/{session_id}/public-share">client.sessions.publicShare.<a href="./src/resources/sessions/public-share.ts">create</a>(sessionID) -> ShareView</code>
4642
- <code title="get /sessions/{session_id}/public-share">client.sessions.publicShare.<a href="./src/resources/sessions/public-share.ts">retrieve</a>(sessionID) -> ShareView</code>
47-
- <code title="delete /sessions/{session_id}/public-share">client.sessions.publicShare.<a href="./src/resources/sessions/public-share.ts">delete</a>(sessionID) -> unknown</code>
43+
- <code title="delete /sessions/{session_id}/public-share">client.sessions.publicShare.<a href="./src/resources/sessions/public-share.ts">delete</a>(sessionID) -> void</code>
4844

4945
# BrowserProfiles
5046

@@ -53,28 +49,26 @@ Types:
5349
- <code><a href="./src/resources/browser-profiles.ts">BrowserProfileView</a></code>
5450
- <code><a href="./src/resources/browser-profiles.ts">ProxyCountryCode</a></code>
5551
- <code><a href="./src/resources/browser-profiles.ts">BrowserProfileListResponse</a></code>
56-
- <code><a href="./src/resources/browser-profiles.ts">BrowserProfileDeleteResponse</a></code>
5752

5853
Methods:
5954

6055
- <code title="post /browser-profiles">client.browserProfiles.<a href="./src/resources/browser-profiles.ts">create</a>({ ...params }) -> BrowserProfileView</code>
6156
- <code title="get /browser-profiles/{profile_id}">client.browserProfiles.<a href="./src/resources/browser-profiles.ts">retrieve</a>(profileID) -> BrowserProfileView</code>
6257
- <code title="patch /browser-profiles/{profile_id}">client.browserProfiles.<a href="./src/resources/browser-profiles.ts">update</a>(profileID, { ...params }) -> BrowserProfileView</code>
6358
- <code title="get /browser-profiles">client.browserProfiles.<a href="./src/resources/browser-profiles.ts">list</a>({ ...params }) -> BrowserProfileListResponse</code>
64-
- <code title="delete /browser-profiles/{profile_id}">client.browserProfiles.<a href="./src/resources/browser-profiles.ts">delete</a>(profileID) -> unknown</code>
59+
- <code title="delete /browser-profiles/{profile_id}">client.browserProfiles.<a href="./src/resources/browser-profiles.ts">delete</a>(profileID) -> void</code>
6560

6661
# AgentProfiles
6762

6863
Types:
6964

7065
- <code><a href="./src/resources/agent-profiles.ts">AgentProfileView</a></code>
7166
- <code><a href="./src/resources/agent-profiles.ts">AgentProfileListResponse</a></code>
72-
- <code><a href="./src/resources/agent-profiles.ts">AgentProfileDeleteResponse</a></code>
7367

7468
Methods:
7569

7670
- <code title="post /agent-profiles">client.agentProfiles.<a href="./src/resources/agent-profiles.ts">create</a>({ ...params }) -> AgentProfileView</code>
7771
- <code title="get /agent-profiles/{profile_id}">client.agentProfiles.<a href="./src/resources/agent-profiles.ts">retrieve</a>(profileID) -> AgentProfileView</code>
7872
- <code title="patch /agent-profiles/{profile_id}">client.agentProfiles.<a href="./src/resources/agent-profiles.ts">update</a>(profileID, { ...params }) -> AgentProfileView</code>
7973
- <code title="get /agent-profiles">client.agentProfiles.<a href="./src/resources/agent-profiles.ts">list</a>({ ...params }) -> AgentProfileListResponse</code>
80-
- <code title="delete /agent-profiles/{profile_id}">client.agentProfiles.<a href="./src/resources/agent-profiles.ts">delete</a>(profileID) -> unknown</code>
74+
- <code title="delete /agent-profiles/{profile_id}">client.agentProfiles.<a href="./src/resources/agent-profiles.ts">delete</a>(profileID) -> void</code>

src/client.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import * as API from './resources/index';
1818
import { APIPromise } from './core/api-promise';
1919
import {
2020
AgentProfileCreateParams,
21-
AgentProfileDeleteResponse,
2221
AgentProfileListParams,
2322
AgentProfileListResponse,
2423
AgentProfileUpdateParams,
@@ -27,7 +26,6 @@ import {
2726
} from './resources/agent-profiles';
2827
import {
2928
BrowserProfileCreateParams,
30-
BrowserProfileDeleteResponse,
3129
BrowserProfileListParams,
3230
BrowserProfileListResponse,
3331
BrowserProfileUpdateParams,
@@ -41,10 +39,6 @@ import {
4139
TaskListParams,
4240
TaskListResponse,
4341
TaskRetrieveLogsResponse,
44-
TaskRetrieveOutputFileParams,
45-
TaskRetrieveOutputFileResponse,
46-
TaskRetrieveParams,
47-
TaskRetrieveResponse,
4842
TaskStatus,
4943
TaskUpdateParams,
5044
TaskView,
@@ -248,10 +242,6 @@ export class BrowserUse {
248242
return;
249243
}
250244

251-
protected async authHeaders(opts: FinalRequestOptions): Promise<NullableHeaders | undefined> {
252-
return buildHeaders([{ 'X-Browser-Use-API-Key': this.apiKey }]);
253-
}
254-
255245
/**
256246
* Basic re-implementation of `qs.stringify` for primitive types.
257247
*/
@@ -689,7 +679,6 @@ export class BrowserUse {
689679
...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}),
690680
...getPlatformHeaders(),
691681
},
692-
await this.authHeaders(options),
693682
this._options.defaultHeaders,
694683
bodyHeaders,
695684
options.headers,
@@ -773,15 +762,11 @@ export declare namespace BrowserUse {
773762
type LlmModel as LlmModel,
774763
type TaskStatus as TaskStatus,
775764
type TaskView as TaskView,
776-
type TaskRetrieveResponse as TaskRetrieveResponse,
777765
type TaskListResponse as TaskListResponse,
778766
type TaskRetrieveLogsResponse as TaskRetrieveLogsResponse,
779-
type TaskRetrieveOutputFileResponse as TaskRetrieveOutputFileResponse,
780767
type TaskCreateParams as TaskCreateParams,
781-
type TaskRetrieveParams as TaskRetrieveParams,
782768
type TaskUpdateParams as TaskUpdateParams,
783769
type TaskListParams as TaskListParams,
784-
type TaskRetrieveOutputFileParams as TaskRetrieveOutputFileParams,
785770
};
786771

787772
export {
@@ -799,7 +784,6 @@ export declare namespace BrowserUse {
799784
type BrowserProfileView as BrowserProfileView,
800785
type ProxyCountryCode as ProxyCountryCode,
801786
type BrowserProfileListResponse as BrowserProfileListResponse,
802-
type BrowserProfileDeleteResponse as BrowserProfileDeleteResponse,
803787
type BrowserProfileCreateParams as BrowserProfileCreateParams,
804788
type BrowserProfileUpdateParams as BrowserProfileUpdateParams,
805789
type BrowserProfileListParams as BrowserProfileListParams,
@@ -809,7 +793,6 @@ export declare namespace BrowserUse {
809793
AgentProfiles as AgentProfiles,
810794
type AgentProfileView as AgentProfileView,
811795
type AgentProfileListResponse as AgentProfileListResponse,
812-
type AgentProfileDeleteResponse as AgentProfileDeleteResponse,
813796
type AgentProfileCreateParams as AgentProfileCreateParams,
814797
type AgentProfileUpdateParams as AgentProfileUpdateParams,
815798
type AgentProfileListParams as AgentProfileListParams,

src/internal/utils/log.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ export const formatRequestDetails = (details: {
106106
([name, value]) => [
107107
name,
108108
(
109-
name.toLowerCase() === 'x-browser-use-api-key' ||
110109
name.toLowerCase() === 'authorization' ||
111110
name.toLowerCase() === 'cookie' ||
112111
name.toLowerCase() === 'set-cookie'

0 commit comments

Comments
 (0)