Skip to content

Commit 7d08c1a

Browse files
stainless-app[bot]Stainless Botmaxbeatty
authored
release: 2.0.1 (#49)
Automated Release PR --- ## 2.0.1 (2024-11-19) Full Changelog: [v2.0.0...v2.0.1](v2.0.0...v2.0.1) ### Features * **api:** api update ([#40](#40)) ([97dddaa](97dddaa)) * **api:** api update ([#42](#42)) ([2ad71d8](2ad71d8)) * various codegen changes ([7615211](7615211)) ### Bug Fixes * update example ([#38](#38)) ([242167d](242167d)) ### Chores * rebuild project due to codegen change ([#44](#44)) ([804a9ec](804a9ec)) * rebuild project due to codegen change ([#45](#45)) ([889bd8d](889bd8d)) * rebuild project due to codegen change ([#47](#47)) ([4d08a25](4d08a25)) * rebuild project due to codegen change ([#48](#48)) ([189b64f](189b64f)) --- This pull request is managed by Stainless's [GitHub App](https://github.com/apps/stainless-app). The [semver version number](https://semver.org/#semantic-versioning-specification-semver) is based on included [commit messages](https://www.conventionalcommits.org/en/v1.0.0/). Alternatively, you can manually set the version number in the title of this pull request. For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request. 🔗 Stainless [website](https://www.stainlessapi.com) 📚 Read the [docs](https://app.stainlessapi.com/docs) 🙋 [Reach out](mailto:[email protected]) for help or questions --------- Co-authored-by: Stainless Bot <[email protected]> Co-authored-by: Max Beatty <[email protected]> Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 2ecb572 commit 7d08c1a

27 files changed

+218
-382
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ yarn-error.log
44
codegen.log
55
Brewfile.lock.json
66
dist
7-
/deno
7+
dist-deno
88
/*.tgz
99
.idea/
1010

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.0.0"
2+
".": "2.0.1"
33
}

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 18
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-b341dd9d5bb77c4f217b94b186763e730fd798fbb773a5e90bb4e2a8d4a2c822.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-7f88912695bab2b98cb73137e6f36125d02fdfaf8eed4532ee1c82385609a259.yml

CHANGELOG.md

+23
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# Changelog
22

3+
## 2.0.1 (2024-11-19)
4+
5+
Full Changelog: [v2.0.0...v2.0.1](https://github.com/browserbase/sdk-node/compare/v2.0.0...v2.0.1)
6+
7+
### Features
8+
9+
* **api:** api update ([#40](https://github.com/browserbase/sdk-node/issues/40)) ([97dddaa](https://github.com/browserbase/sdk-node/commit/97dddaa2729f64c4d1dbf20bebf7c243e3fb723b))
10+
* **api:** api update ([#42](https://github.com/browserbase/sdk-node/issues/42)) ([2ad71d8](https://github.com/browserbase/sdk-node/commit/2ad71d8e96157370ec64619568d185805dcc97a2))
11+
* various codegen changes ([7615211](https://github.com/browserbase/sdk-node/commit/7615211d48d953fe0833d35a3986f24673659840))
12+
13+
14+
### Bug Fixes
15+
16+
* update example ([#38](https://github.com/browserbase/sdk-node/issues/38)) ([242167d](https://github.com/browserbase/sdk-node/commit/242167d2a82a6239fda100ad014436c9ee77a1de))
17+
18+
19+
### Chores
20+
21+
* rebuild project due to codegen change ([#44](https://github.com/browserbase/sdk-node/issues/44)) ([804a9ec](https://github.com/browserbase/sdk-node/commit/804a9ec93ae35b48c6c7d89948a4146abf5ab8cc))
22+
* rebuild project due to codegen change ([#45](https://github.com/browserbase/sdk-node/issues/45)) ([889bd8d](https://github.com/browserbase/sdk-node/commit/889bd8d94a245a1f9e26dc6877b045fc5bcbae0a))
23+
* rebuild project due to codegen change ([#47](https://github.com/browserbase/sdk-node/issues/47)) ([4d08a25](https://github.com/browserbase/sdk-node/commit/4d08a25596cf991be1576d10fa9801cb057b157b))
24+
* rebuild project due to codegen change ([#48](https://github.com/browserbase/sdk-node/issues/48)) ([189b64f](https://github.com/browserbase/sdk-node/commit/189b64fca8fe9ee76ff0b888108cd276f0387ad3))
25+
326
## 2.0.0 (2024-10-29)
427

528
🆕 fully-featured SDK for Browserbase's API

LICENSE

-201
This file was deleted.

README.md

+25-18
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const client = new Browserbase({
2727
});
2828

2929
async function main() {
30-
const session = await client.sessions.create({ projectId: 'your_project_id', proxies: true });
30+
const session = await client.sessions.create({ projectId: 'your_project_id' });
3131

3232
console.log(session.id);
3333
}
@@ -48,7 +48,7 @@ const client = new Browserbase({
4848
});
4949

5050
async function main() {
51-
const params: Browserbase.SessionCreateParams = { projectId: 'your_project_id', proxies: true };
51+
const params: Browserbase.SessionCreateParams = { projectId: 'your_project_id' };
5252
const session: Browserbase.SessionCreateResponse = await client.sessions.create(params);
5353
}
5454

@@ -66,17 +66,15 @@ a subclass of `APIError` will be thrown:
6666
<!-- prettier-ignore -->
6767
```ts
6868
async function main() {
69-
const session = await client.sessions
70-
.create({ projectId: 'your_project_id', proxies: true })
71-
.catch(async (err) => {
72-
if (err instanceof Browserbase.APIError) {
73-
console.log(err.status); // 400
74-
console.log(err.name); // BadRequestError
75-
console.log(err.headers); // {server: 'nginx', ...}
76-
} else {
77-
throw err;
78-
}
79-
});
69+
const session = await client.sessions.create({ projectId: 'your_project_id' }).catch(async (err) => {
70+
if (err instanceof Browserbase.APIError) {
71+
console.log(err.status); // 400
72+
console.log(err.name); // BadRequestError
73+
console.log(err.headers); // {server: 'nginx', ...}
74+
} else {
75+
throw err;
76+
}
77+
});
8078
}
8179

8280
main();
@@ -111,7 +109,7 @@ const client = new Browserbase({
111109
});
112110

113111
// Or, configure per-request:
114-
await client.sessions.create({ projectId: 'your_project_id', proxies: true }, {
112+
await client.sessions.create({ projectId: 'your_project_id' }, {
115113
maxRetries: 5,
116114
});
117115
```
@@ -128,7 +126,7 @@ const client = new Browserbase({
128126
});
129127

130128
// Override per-request:
131-
await client.sessions.create({ projectId: 'your_project_id', proxies: true }, {
129+
await client.sessions.create({ projectId: 'your_project_id' }, {
132130
timeout: 5 * 1000,
133131
});
134132
```
@@ -149,12 +147,12 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi
149147
```ts
150148
const client = new Browserbase();
151149

152-
const response = await client.sessions.create({ projectId: 'your_project_id', proxies: true }).asResponse();
150+
const response = await client.sessions.create({ projectId: 'your_project_id' }).asResponse();
153151
console.log(response.headers.get('X-My-Header'));
154152
console.log(response.statusText); // access the underlying Response object
155153

156154
const { data: session, response: raw } = await client.sessions
157-
.create({ projectId: 'your_project_id', proxies: true })
155+
.create({ projectId: 'your_project_id' })
158156
.withResponse();
159157
console.log(raw.headers.get('X-My-Header'));
160158
console.log(session.id);
@@ -262,7 +260,7 @@ const client = new Browserbase({
262260

263261
// Override per-request:
264262
await client.sessions.create(
265-
{ projectId: 'your_project_id', proxies: true },
263+
{ projectId: 'your_project_id' },
266264
{
267265
httpAgent: new http.Agent({ keepAlive: false }),
268266
},
@@ -287,6 +285,15 @@ TypeScript >= 4.5 is supported.
287285

288286
The following runtimes are supported:
289287

288+
- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)
289+
- Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
290+
- Deno v1.28.0 or higher, using `import Browserbase from "npm:@browserbasehq/sdk"`.
291+
- Bun 1.0 or later.
292+
- Cloudflare Workers.
293+
- Vercel Edge Runtime.
294+
- Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time).
295+
- Nitro v2.6 or greater.
296+
290297
Note that React Native is not supported at this time.
291298

292299
If you are interested in other runtime environments, please open or upvote an issue on GitHub.

examples/playwright-basic.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const bb = new Browserbase({
1818
const browser = await chromium.connectOverCDP(session.connectUrl);
1919

2020
// Getting the default context to ensure the sessions are recorded.
21-
const defaultContext = browser.contexts()[0];
21+
const [defaultContext] = browser.contexts();
2222
const page = defaultContext?.pages()[0];
2323

2424
await page?.goto('https://browserbase.com/');

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@browserbasehq/sdk",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "The official Node.js library for the Browserbase API",
55
"author": "Browserbase <[email protected]>",
66
"types": "dist/index.d.ts",
@@ -50,7 +50,6 @@
5050
"puppeteer-core": "^19.7.2",
5151
"selenium-webdriver": "^4.2.0",
5252
"ts-jest": "^29.1.0",
53-
"ts-morph": "^19.0.0",
5453
"ts-node": "^10.5.0",
5554
"tsc-multi": "^1.1.0",
5655
"tsconfig-paths": "^4.0.0",

0 commit comments

Comments
 (0)