Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@ A full reference for this library is available [here](https://github.com/browser
Instantiate and use the client with the following:

```typescript
import { BrowserUseClient } from "";
import { BrowserUseEnvironment, BrowserUseClient } from "";

const client = new BrowserUseClient({ environment: "YOUR_BASE_URL", apiKey: "YOUR_API_KEY" });
const client = new BrowserUseClient({ environment: BrowserUseEnvironment.Production, apiKey: "YOUR_API_KEY" });
await client.tasks.createTask({
task: "task",
});
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "",
"version": "0.0.32",
"version": "0.0.34",
"private": false,
"repository": "github:browser-use/browser-use-node",
"type": "commonjs",
Expand Down Expand Up @@ -47,22 +47,22 @@
"zod": "^4"
},
"devDependencies": {
"@dotenvx/dotenvx": "^1.49.0",
"webpack": "^5.97.1",
"ts-loader": "^9.5.1",
"jest": "^29.7.0",
"@jest/globals": "^29.7.0",
"@types/jest": "^29.5.14",
"@types/node": "^18.19.70",
"jest": "^29.7.0",
"ts-jest": "^29.3.4",
"jest-environment-jsdom": "^29.7.0",
"msw": "^2.8.4",
"@types/node": "^18.19.70",
"prettier": "^3.4.2",
"typescript": "~5.7.2",
"@dotenvx/dotenvx": "^1.49.0",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"ts-jest": "^29.3.4",
"ts-loader": "^9.5.1",
"ts-node": "^10.5.0",
"tsconfig-paths": "^4.2.0",
"typescript": "~5.7.2",
"webpack": "^5.97.1",
"ts-node": "^10.5.0",
"zod": "^4"
},
"browser": {
Expand Down
82 changes: 37 additions & 45 deletions reference.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Reference

## Account
## Accounts

<details><summary><code>client.account.<a href="/src/api/resources/account/client/Client.ts">getAccountMe</a>() -> BrowserUse.AccountView</code></summary>
<details><summary><code>client.accounts.<a href="/src/api/resources/accounts/client/Client.ts">getAccountMe</a>() -> BrowserUse.AccountView</code></summary>
<dl>
<dd>

Expand Down Expand Up @@ -30,7 +30,7 @@ Get authenticated account information including credit balances and account deta
<dd>

```typescript
await client.account.getAccountMe();
await client.accounts.getAccountMe();
```

</dd>
Expand All @@ -46,7 +46,7 @@ await client.account.getAccountMe();
<dl>
<dd>

**requestOptions:** `Account.RequestOptions`
**requestOptions:** `Accounts.RequestOptions`

</dd>
</dl>
Expand Down Expand Up @@ -453,7 +453,7 @@ await client.sessions.listSessions();
</dl>
</details>

<details><summary><code>client.sessions.<a href="/src/api/resources/sessions/client/Client.ts">createSession</a>({ ...params }) -> BrowserUse.SessionView</code></summary>
<details><summary><code>client.sessions.<a href="/src/api/resources/sessions/client/Client.ts">createSession</a>({ ...params }) -> BrowserUse.SessionItemView</code></summary>
<dl>
<dd>

Expand Down Expand Up @@ -979,7 +979,7 @@ await client.files.userUploadFilePresignedUrl("session_id", {
</dl>
</details>

<details><summary><code>client.files.<a href="/src/api/resources/files/client/Client.ts">getTaskUserUploadedFilePresignedUrl</a>(taskId, fileId) -> BrowserUse.TaskUploadedFileResponse</code></summary>
<details><summary><code>client.files.<a href="/src/api/resources/files/client/Client.ts">getTaskOutputFilePresignedUrl</a>(taskId, fileId) -> BrowserUse.TaskOutputFileResponse</code></summary>
<dl>
<dd>

Expand All @@ -991,7 +991,7 @@ await client.files.userUploadFilePresignedUrl("session_id", {
<dl>
<dd>

Get secure download URL for a user uploaded file used in the task.
Get secure download URL for an output file generated by the AI agent.

</dd>
</dl>
Expand All @@ -1007,7 +1007,7 @@ Get secure download URL for a user uploaded file used in the task.
<dd>

```typescript
await client.files.getTaskUserUploadedFilePresignedUrl("task_id", "file_id");
await client.files.getTaskOutputFilePresignedUrl("task_id", "file_id");
```

</dd>
Expand Down Expand Up @@ -1050,7 +1050,9 @@ await client.files.getTaskUserUploadedFilePresignedUrl("task_id", "file_id");
</dl>
</details>

<details><summary><code>client.files.<a href="/src/api/resources/files/client/Client.ts">getTaskOutputFilePresignedUrl</a>(taskId, fileId) -> BrowserUse.TaskOutputFileResponse</code></summary>
## Profiles

<details><summary><code>client.profiles.<a href="/src/api/resources/profiles/client/Client.ts">listProfiles</a>({ ...params }) -> BrowserUse.ProfileListResponse</code></summary>
<dl>
<dd>

Expand All @@ -1062,7 +1064,7 @@ await client.files.getTaskUserUploadedFilePresignedUrl("task_id", "file_id");
<dl>
<dd>

Get secure download URL for an output file generated by the AI agent.
Get paginated list of profiles.

</dd>
</dl>
Expand All @@ -1078,7 +1080,7 @@ Get secure download URL for an output file generated by the AI agent.
<dd>

```typescript
await client.files.getTaskOutputFilePresignedUrl("task_id", "file_id");
await client.profiles.listProfiles();
```

</dd>
Expand All @@ -1094,23 +1096,15 @@ await client.files.getTaskOutputFilePresignedUrl("task_id", "file_id");
<dl>
<dd>

**taskId:** `string`

</dd>
</dl>

<dl>
<dd>

**fileId:** `string`
**request:** `BrowserUse.ListProfilesProfilesGetRequest`

</dd>
</dl>

<dl>
<dd>

**requestOptions:** `Files.RequestOptions`
**requestOptions:** `Profiles.RequestOptions`

</dd>
</dl>
Expand All @@ -1121,9 +1115,7 @@ await client.files.getTaskOutputFilePresignedUrl("task_id", "file_id");
</dl>
</details>

## Profiles

<details><summary><code>client.profiles.<a href="/src/api/resources/profiles/client/Client.ts">listProfiles</a>({ ...params }) -> BrowserUse.ProfileListResponse</code></summary>
<details><summary><code>client.profiles.<a href="/src/api/resources/profiles/client/Client.ts">createProfile</a>() -> BrowserUse.ProfileView</code></summary>
<dl>
<dd>

Expand All @@ -1135,7 +1127,12 @@ await client.files.getTaskOutputFilePresignedUrl("task_id", "file_id");
<dl>
<dd>

Get paginated list of profiles.
Profiles allow you to preserve the state of the browser between tasks.

They are most commonly used to allow users to preserve the log-in state in the agent between tasks.
You'd normally create one profile per user and then use it for all their tasks.

You can create a new profile by calling this endpoint.

</dd>
</dl>
Expand All @@ -1151,7 +1148,7 @@ Get paginated list of profiles.
<dd>

```typescript
await client.profiles.listProfiles();
await client.profiles.createProfile();
```

</dd>
Expand All @@ -1167,14 +1164,6 @@ await client.profiles.listProfiles();
<dl>
<dd>

**request:** `BrowserUse.ListProfilesProfilesGetRequest`

</dd>
</dl>

<dl>
<dd>

**requestOptions:** `Profiles.RequestOptions`

</dd>
Expand All @@ -1186,7 +1175,7 @@ await client.profiles.listProfiles();
</dl>
</details>

<details><summary><code>client.profiles.<a href="/src/api/resources/profiles/client/Client.ts">createProfile</a>() -> BrowserUse.ProfileView</code></summary>
<details><summary><code>client.profiles.<a href="/src/api/resources/profiles/client/Client.ts">getProfile</a>(profileId) -> BrowserUse.ProfileView</code></summary>
<dl>
<dd>

Expand All @@ -1198,12 +1187,7 @@ await client.profiles.listProfiles();
<dl>
<dd>

Profiles allow you to preserve the state of the browser between tasks.

They are most commonly used to allow users to preserve the log-in state in the agent between tasks.
You'd normally create one profile per user and then use it for all their tasks.

You can create a new profile by calling this endpoint.
Get profile details.

</dd>
</dl>
Expand All @@ -1219,7 +1203,7 @@ You can create a new profile by calling this endpoint.
<dd>

```typescript
await client.profiles.createProfile();
await client.profiles.getProfile("profile_id");
```

</dd>
Expand All @@ -1235,6 +1219,14 @@ await client.profiles.createProfile();
<dl>
<dd>

**profileId:** `string`

</dd>
</dl>

<dl>
<dd>

**requestOptions:** `Profiles.RequestOptions`

</dd>
Expand All @@ -1246,7 +1238,7 @@ await client.profiles.createProfile();
</dl>
</details>

<details><summary><code>client.profiles.<a href="/src/api/resources/profiles/client/Client.ts">getProfile</a>(profileId) -> BrowserUse.ProfileView</code></summary>
<details><summary><code>client.profiles.<a href="/src/api/resources/profiles/client/Client.ts">deleteBrowserProfile</a>(profileId) -> void</code></summary>
<dl>
<dd>

Expand All @@ -1258,7 +1250,7 @@ await client.profiles.createProfile();
<dl>
<dd>

Get profile details.
Permanently delete a browser profile and its configuration.

</dd>
</dl>
Expand All @@ -1274,7 +1266,7 @@ Get profile details.
<dd>

```typescript
await client.profiles.getProfile("profile_id");
await client.profiles.deleteBrowserProfile("profile_id");
```

</dd>
Expand Down
14 changes: 7 additions & 7 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as environments from "./environments.js";
import * as core from "./core/index.js";
import { mergeHeaders } from "./core/headers.js";
import { Account } from "./api/resources/account/client/Client.js";
import { Accounts } from "./api/resources/accounts/client/Client.js";
import { Tasks } from "./api/resources/tasks/client/Client.js";
import { Sessions } from "./api/resources/sessions/client/Client.js";
import { Files } from "./api/resources/files/client/Client.js";
import { Profiles } from "./api/resources/profiles/client/Client.js";

export declare namespace BrowserUseClient {
export interface Options {
environment: core.Supplier<string>;
environment: core.Supplier<environments.BrowserUseEnvironment | string>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
apiKey: core.Supplier<string>;
Expand All @@ -36,7 +37,7 @@ export declare namespace BrowserUseClient {

export class BrowserUseClient {
protected readonly _options: BrowserUseClient.Options;
protected _account: Account | undefined;
protected _accounts: Accounts | undefined;
protected _tasks: Tasks | undefined;
protected _sessions: Sessions | undefined;
protected _files: Files | undefined;
Expand All @@ -49,8 +50,7 @@ export class BrowserUseClient {
{
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "",
"X-Fern-SDK-Version": "0.0.32",

"X-Fern-SDK-Version": "0.0.34",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand All @@ -59,8 +59,8 @@ export class BrowserUseClient {
};
}

public get account(): Account {
return (this._account ??= new Account(this._options));
public get accounts(): Accounts {
return (this._accounts ??= new Accounts(this._options));
}

public get tasks(): Tasks {
Expand Down
Loading