Skip to content
Merged
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 { BrowserUseEnvironment, BrowserUseClient } from "";
import { BrowserUseClient } from "";

const client = new BrowserUseClient({ environment: BrowserUseEnvironment.Production, apiKey: "YOUR_API_KEY" });
const client = new BrowserUseClient({ apiKey: "YOUR_API_KEY" });
await client.tasks.createTask({
task: "task",
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "",
"version": "0.0.35",
"version": "0.0.37",
"private": false,
"repository": "github:browser-use/browser-use-node",
"type": "commonjs",
Expand Down
4 changes: 2 additions & 2 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Profiles } from "./api/resources/profiles/client/Client.js";

export declare namespace BrowserUseClient {
export interface Options {
environment: core.Supplier<environments.BrowserUseEnvironment | 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 Down Expand Up @@ -50,7 +50,7 @@ export class BrowserUseClient {
{
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "",
"X-Fern-SDK-Version": "0.0.35",
"X-Fern-SDK-Version": "0.0.37",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
5 changes: 3 additions & 2 deletions src/api/resources/accounts/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as errors from "../../../../errors/index.js";

export declare namespace Accounts {
export interface Options {
environment: core.Supplier<environments.BrowserUseEnvironment | 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 Down Expand Up @@ -64,7 +64,8 @@ export class Accounts {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
"accounts/me",
),
method: "GET",
Expand Down
8 changes: 5 additions & 3 deletions src/api/resources/files/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as errors from "../../../../errors/index.js";

export declare namespace Files {
export interface Options {
environment: core.Supplier<environments.BrowserUseEnvironment | 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 Down Expand Up @@ -81,7 +81,8 @@ export class Files {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
`files/sessions/${encodeURIComponent(sessionId)}/presigned-url`,
),
method: "POST",
Expand Down Expand Up @@ -179,7 +180,8 @@ export class Files {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
`files/tasks/${encodeURIComponent(taskId)}/output-files/${encodeURIComponent(fileId)}`,
),
method: "GET",
Expand Down
14 changes: 9 additions & 5 deletions src/api/resources/profiles/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as errors from "../../../../errors/index.js";

export declare namespace Profiles {
export interface Options {
environment: core.Supplier<environments.BrowserUseEnvironment | 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 Down Expand Up @@ -79,7 +79,8 @@ export class Profiles {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
"profiles",
),
method: "GET",
Expand Down Expand Up @@ -157,7 +158,8 @@ export class Profiles {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
"profiles",
),
method: "POST",
Expand Down Expand Up @@ -240,7 +242,8 @@ export class Profiles {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
`profiles/${encodeURIComponent(profileId)}`,
),
method: "GET",
Expand Down Expand Up @@ -319,7 +322,8 @@ export class Profiles {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
`profiles/${encodeURIComponent(profileId)}`,
),
method: "DELETE",
Expand Down
26 changes: 17 additions & 9 deletions src/api/resources/sessions/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as errors from "../../../../errors/index.js";

export declare namespace Sessions {
export interface Options {
environment: core.Supplier<environments.BrowserUseEnvironment | 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 Down Expand Up @@ -83,7 +83,8 @@ export class Sessions {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
"sessions",
),
method: "GET",
Expand Down Expand Up @@ -161,7 +162,8 @@ export class Sessions {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
"sessions",
),
method: "POST",
Expand Down Expand Up @@ -244,7 +246,8 @@ export class Sessions {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
`sessions/${encodeURIComponent(sessionId)}`,
),
method: "GET",
Expand Down Expand Up @@ -320,7 +323,8 @@ export class Sessions {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
`sessions/${encodeURIComponent(sessionId)}`,
),
method: "DELETE",
Expand Down Expand Up @@ -401,7 +405,8 @@ export class Sessions {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
`sessions/${encodeURIComponent(sessionId)}`,
),
method: "PATCH",
Expand Down Expand Up @@ -484,7 +489,8 @@ export class Sessions {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
`sessions/${encodeURIComponent(sessionId)}/public-share`,
),
method: "GET",
Expand Down Expand Up @@ -566,7 +572,8 @@ export class Sessions {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
`sessions/${encodeURIComponent(sessionId)}/public-share`,
),
method: "POST",
Expand Down Expand Up @@ -648,7 +655,8 @@ export class Sessions {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
`sessions/${encodeURIComponent(sessionId)}/public-share`,
),
method: "DELETE",
Expand Down
17 changes: 11 additions & 6 deletions src/api/resources/tasks/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as errors from "../../../../errors/index.js";

export declare namespace Tasks {
export interface Options {
environment: core.Supplier<environments.BrowserUseEnvironment | 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 Down Expand Up @@ -95,7 +95,8 @@ export class Tasks {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
"tasks",
),
method: "GET",
Expand Down Expand Up @@ -180,7 +181,8 @@ export class Tasks {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
"tasks",
),
method: "POST",
Expand Down Expand Up @@ -272,7 +274,8 @@ export class Tasks {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
`tasks/${encodeURIComponent(taskId)}`,
),
method: "GET",
Expand Down Expand Up @@ -357,7 +360,8 @@ export class Tasks {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
`tasks/${encodeURIComponent(taskId)}`,
),
method: "PATCH",
Expand Down Expand Up @@ -441,7 +445,8 @@ export class Tasks {
const _response = await core.fetcher({
url: core.url.join(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)),
(await core.Supplier.get(this._options.environment)) ??
environments.BrowserUseEnvironment.Production,
`tasks/${encodeURIComponent(taskId)}/logs`,
),
method: "GET",
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const SDK_VERSION = "0.0.35";
export const SDK_VERSION = "0.0.37";