Skip to content

Commit fc2c530

Browse files
authored
Merge pull request #20 from browser-use/release-please--branches--main--changes--next--components--browser-use-sdk
release: 0.7.0
2 parents b1cf3a3 + 7f36b3f commit fc2c530

File tree

12 files changed

+158
-29
lines changed

12 files changed

+158
-29
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.6.0"
2+
".": "0.7.0"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 26
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browser-use%2Fbrowser-use-9f5ca0cd0a64c620cebceaebf7c6f8c3a917aa6fbc2ea6b9d2a6e3b9d17aaea4.yml
3-
openapi_spec_hash: 3d30ebd2ed6ab3a5b42b6b267a45d34f
4-
config_hash: 9d52be5177b2ede4cb0633c04f4cc4ef
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browser-use%2Fbrowser-use-ce018db4d6891d645cfb220c86d17ac1d431e1ba2f604e8015876b17a5a11149.yml
3+
openapi_spec_hash: e9a00924682ab214ca5d8b6b5c84430e
4+
config_hash: dd3e22b635fa0eb9a7c741a8aaca2a7f

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## 0.7.0 (2025-08-19)
4+
5+
Full Changelog: [v0.6.0...v0.7.0](https://github.com/browser-use/browser-use-node/compare/v0.6.0...v0.7.0)
6+
7+
### Features
8+
9+
* **api:** manual updates ([d339b83](https://github.com/browser-use/browser-use-node/commit/d339b83355a358c7a55fa501576403cb30e0aa31))
10+
* **api:** manual updates ([5d09807](https://github.com/browser-use/browser-use-node/commit/5d09807eb2cb8fa30555775d0a5cb21b2c7f3c7f))
11+
312
## 0.6.0 (2025-08-19)
413

514
Full Changelog: [v0.5.1...v0.6.0](https://github.com/browser-use/browser-use-node/compare/v0.5.1...v0.6.0)

README.md

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ const client = new BrowserUse({
2626
apiKey: process.env['BROWSER_USE_API_KEY'], // This is the default and can be omitted
2727
});
2828

29-
const me = await client.users.me.retrieve();
29+
const task = await client.tasks.create({
30+
task: 'Search for the top 10 Hacker News posts and return the title and url.',
31+
});
3032

31-
console.log(me.additionalCreditsBalanceUsd);
33+
console.log(task.id);
3234
```
3335

3436
### Request & Response types
@@ -43,7 +45,10 @@ const client = new BrowserUse({
4345
apiKey: process.env['BROWSER_USE_API_KEY'], // This is the default and can be omitted
4446
});
4547

46-
const me: BrowserUse.Users.MeRetrieveResponse = await client.users.me.retrieve();
48+
const params: BrowserUse.TaskCreateParams = {
49+
task: 'Search for the top 10 Hacker News posts and return the title and url.',
50+
};
51+
const task: BrowserUse.TaskCreateResponse = await client.tasks.create(params);
4752
```
4853

4954
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
@@ -56,15 +61,17 @@ a subclass of `APIError` will be thrown:
5661

5762
<!-- prettier-ignore -->
5863
```ts
59-
const me = await client.users.me.retrieve().catch(async (err) => {
60-
if (err instanceof BrowserUse.APIError) {
61-
console.log(err.status); // 400
62-
console.log(err.name); // BadRequestError
63-
console.log(err.headers); // {server: 'nginx', ...}
64-
} else {
65-
throw err;
66-
}
67-
});
64+
const task = await client.tasks
65+
.create({ task: 'Search for the top 10 Hacker News posts and return the title and url.' })
66+
.catch(async (err) => {
67+
if (err instanceof BrowserUse.APIError) {
68+
console.log(err.status); // 400
69+
console.log(err.name); // BadRequestError
70+
console.log(err.headers); // {server: 'nginx', ...}
71+
} else {
72+
throw err;
73+
}
74+
});
6875
```
6976

7077
Error codes are as follows:
@@ -96,7 +103,7 @@ const client = new BrowserUse({
96103
});
97104

98105
// Or, configure per-request:
99-
await client.users.me.retrieve({
106+
await client.tasks.create({ task: 'Search for the top 10 Hacker News posts and return the title and url.' }, {
100107
maxRetries: 5,
101108
});
102109
```
@@ -113,7 +120,7 @@ const client = new BrowserUse({
113120
});
114121

115122
// Override per-request:
116-
await client.users.me.retrieve({
123+
await client.tasks.create({ task: 'Search for the top 10 Hacker News posts and return the title and url.' }, {
117124
timeout: 5 * 1000,
118125
});
119126
```
@@ -136,13 +143,17 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
136143
```ts
137144
const client = new BrowserUse();
138145

139-
const response = await client.users.me.retrieve().asResponse();
146+
const response = await client.tasks
147+
.create({ task: 'Search for the top 10 Hacker News posts and return the title and url.' })
148+
.asResponse();
140149
console.log(response.headers.get('X-My-Header'));
141150
console.log(response.statusText); // access the underlying Response object
142151

143-
const { data: me, response: raw } = await client.users.me.retrieve().withResponse();
152+
const { data: task, response: raw } = await client.tasks
153+
.create({ task: 'Search for the top 10 Hacker News posts and return the title and url.' })
154+
.withResponse();
144155
console.log(raw.headers.get('X-My-Header'));
145-
console.log(me.additionalCreditsBalanceUsd);
156+
console.log(task.id);
146157
```
147158

148159
### Logging
@@ -222,7 +233,7 @@ parameter. This library doesn't validate at runtime that the request matches the
222233
send will be sent as-is.
223234

224235
```ts
225-
client.users.me.retrieve({
236+
client.tasks.create({
226237
// ...
227238
// @ts-expect-error baz is not yet public
228239
baz: 'undocumented option',

examples/run-zod.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env -S npm run tsn -T
2+
3+
import { BrowserUse } from 'browser-use-sdk';
4+
5+
import z from 'zod';
6+
import { env } from './utils';
7+
8+
env();
9+
10+
// gets API Key from environment variable BROWSER_USE_API_KEY
11+
const browseruse = new BrowserUse();
12+
13+
const HackerNewsResponse = z.object({
14+
title: z.string(),
15+
url: z.string(),
16+
score: z.number(),
17+
});
18+
19+
const TaskOutput = z.object({
20+
posts: z.array(HackerNewsResponse),
21+
});
22+
23+
async function main() {
24+
console.log(`Creating Task...`);
25+
26+
// Create Task
27+
const rsp = await browseruse.tasks.run({
28+
task: 'Search for the top 10 Hacker News posts and return the title, url, and score',
29+
schema: TaskOutput,
30+
});
31+
32+
const posts = rsp.doneOutput?.posts;
33+
34+
if (posts == null) {
35+
throw new Error('No posts found');
36+
}
37+
38+
for (const post of posts) {
39+
console.log(`${post.title} (${post.score}) - ${post.url}`);
40+
}
41+
42+
console.log(`\nFound ${posts.length} posts`);
43+
}
44+
45+
main().catch(console.error);

examples/run.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env -S npm run tsn -T
2+
3+
import { BrowserUse } from 'browser-use-sdk';
4+
5+
import { env } from './utils';
6+
7+
env();
8+
9+
// gets API Key from environment variable BROWSER_USE_API_KEY
10+
const browseruse = new BrowserUse();
11+
12+
async function main() {
13+
console.log(`Creating Task...`);
14+
15+
// Create Task
16+
const rsp = await browseruse.tasks.run({
17+
task: "What's the weather line in SF and what's the temperature?",
18+
});
19+
20+
console.log(rsp.doneOutput);
21+
}
22+
23+
main().catch(console.error);

examples/stream-zod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async function main() {
2626
// Create a task and get the stream
2727
const task = await browseruse.tasks.create({
2828
task: 'Extract top 10 Hacker News posts and return the title, url, and score',
29-
structuredOutputJson: TaskOutput,
29+
schema: TaskOutput,
3030
});
3131

3232
const stream = browseruse.tasks.stream({

examples/zod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async function main() {
2828
// Create Task
2929
const rsp = await browseruse.tasks.create({
3030
task: 'Extract top 10 Hacker News posts and return the title, url, and score',
31-
structuredOutputJson: TaskOutput,
31+
schema: TaskOutput,
3232
});
3333

3434
poll: do {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "browser-use-sdk",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"description": "The official TypeScript library for the Browser Use API",
55
"author": "Browser Use <[email protected]>",
66
"types": "dist/index.d.ts",

src/lib/parse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { TaskCreateParams, TaskView } from '../resources/tasks';
44
// RUN
55

66
export type TaskCreateParamsWithSchema<T extends ZodType> = Omit<TaskCreateParams, 'structuredOutputJson'> & {
7-
structuredOutputJson: T;
7+
schema: T;
88
};
99

1010
export function stringifyStructuredOutput<T extends ZodType>(schema: T): string {

0 commit comments

Comments
 (0)