Skip to content

Commit 6ea9475

Browse files
release: 2.6.0 (#159)
Automated Release PR --- ## 2.6.0 (2025-05-16) Full Changelog: [v2.5.0...v2.6.0](v2.5.0...v2.6.0) ### Features * **api:** api update ([0b43bac](0b43bac)) * **api:** api update ([#158](#158)) ([1287216](1287216)) ### Bug Fixes * **api:** improve type resolution when importing as a package ([#163](#163)) ([758c8e0](758c8e0)) * **client:** send `X-Stainless-Timeout` in seconds ([#161](#161)) ([8aea1ee](8aea1ee)) * **mcp:** remove unused tools.ts ([#164](#164)) ([b09bd54](b09bd54)) ### Chores * **ci:** add timeout thresholds for CI jobs ([c813b38](c813b38)) * **ci:** only use depot for staging repos ([475fe50](475fe50)) * **client:** minor internal fixes ([ee36919](ee36919)) * **internal:** add aliases for Record and Array ([#162](#162)) ([e658ed9](e658ed9)) * **internal:** codegen related update ([99b8089](99b8089)) * **internal:** reduce CI branch coverage ([37d8e14](37d8e14)) * **internal:** upload builds and expand CI branch coverage ([d30a38a](d30a38a)) ### Documentation * **readme:** fix typo ([7bc4b9b](7bc4b9b)) --- 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-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 47344ef commit 6ea9475

File tree

12 files changed

+130
-27
lines changed

12 files changed

+130
-27
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
name: CI
22
on:
33
push:
4-
branches:
5-
- main
6-
pull_request:
7-
branches:
8-
- main
9-
- next
4+
branches-ignore:
5+
- 'generated'
6+
- 'codegen/**'
7+
- 'integrated/**'
8+
- 'stl-preview-head/**'
9+
- 'stl-preview-base/**'
1010

1111
jobs:
1212
lint:
13+
timeout-minutes: 10
1314
name: lint
14-
runs-on: ubuntu-latest
15-
15+
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
1616
steps:
1717
- uses: actions/checkout@v4
1818

@@ -28,9 +28,12 @@ jobs:
2828
run: ./scripts/lint
2929

3030
build:
31+
timeout-minutes: 5
3132
name: build
32-
runs-on: ubuntu-latest
33-
33+
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
34+
permissions:
35+
contents: read
36+
id-token: write
3437
steps:
3538
- uses: actions/checkout@v4
3639

@@ -44,10 +47,25 @@ jobs:
4447

4548
- name: Check build
4649
run: ./scripts/build
50+
51+
- name: Get GitHub OIDC Token
52+
if: github.repository == 'stainless-sdks/browserbase-node'
53+
id: github-oidc
54+
uses: actions/github-script@v6
55+
with:
56+
script: core.setOutput('github_token', await core.getIDToken());
57+
58+
- name: Upload tarball
59+
if: github.repository == 'stainless-sdks/browserbase-node'
60+
env:
61+
URL: https://pkg.stainless.com/s
62+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
63+
SHA: ${{ github.sha }}
64+
run: ./scripts/utils/upload-artifact.sh
4765
test:
66+
timeout-minutes: 10
4867
name: test
49-
runs-on: ubuntu-latest
50-
68+
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
5169
steps:
5270
- uses: actions/checkout@v4
5371

.release-please-manifest.json

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

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 18
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-ad8e080c2347b3f28d64f49cf02c2ab4a69b7bf289fd7eb018c955d8915bb990.yml
3-
openapi_spec_hash: b3aea10135a89597634d62f1ef418839
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-e2ed1b5267eeff92982918505349017b9155da2c7ab948787ab11cf9068af1b8.yml
3+
openapi_spec_hash: 6639c21dccb52ca610cae833227a9791
44
config_hash: 74882e23a455dece33e43a27e67f0fbb

CHANGELOG.md

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

3+
## 2.6.0 (2025-05-16)
4+
5+
Full Changelog: [v2.5.0...v2.6.0](https://github.com/browserbase/sdk-node/compare/v2.5.0...v2.6.0)
6+
7+
### Features
8+
9+
* **api:** api update ([0b43bac](https://github.com/browserbase/sdk-node/commit/0b43baccf8dbb13ed4b9bb8feed15849007cc531))
10+
* **api:** api update ([#158](https://github.com/browserbase/sdk-node/issues/158)) ([1287216](https://github.com/browserbase/sdk-node/commit/12872160a6e7be94d82cb4189cf53dc9eecbfbba))
11+
12+
13+
### Bug Fixes
14+
15+
* **api:** improve type resolution when importing as a package ([#163](https://github.com/browserbase/sdk-node/issues/163)) ([758c8e0](https://github.com/browserbase/sdk-node/commit/758c8e048537bdc6d0070a11010ed307b5d4de03))
16+
* **client:** send `X-Stainless-Timeout` in seconds ([#161](https://github.com/browserbase/sdk-node/issues/161)) ([8aea1ee](https://github.com/browserbase/sdk-node/commit/8aea1ee6f66052fa976087c6dbb57f98385c6eee))
17+
* **mcp:** remove unused tools.ts ([#164](https://github.com/browserbase/sdk-node/issues/164)) ([b09bd54](https://github.com/browserbase/sdk-node/commit/b09bd54af116847e852f67bf6c7f0e32dfa92509))
18+
19+
20+
### Chores
21+
22+
* **ci:** add timeout thresholds for CI jobs ([c813b38](https://github.com/browserbase/sdk-node/commit/c813b38b3be8470e2c5b95b58c621ccd7b7ccfe5))
23+
* **ci:** only use depot for staging repos ([475fe50](https://github.com/browserbase/sdk-node/commit/475fe5018be88d96971697bdc3e1b33ae9669310))
24+
* **client:** minor internal fixes ([ee36919](https://github.com/browserbase/sdk-node/commit/ee369190b385d25726cac1e3bc0e23559539d8d9))
25+
* **internal:** add aliases for Record and Array ([#162](https://github.com/browserbase/sdk-node/issues/162)) ([e658ed9](https://github.com/browserbase/sdk-node/commit/e658ed9e739c0479ffd542ffe4b616fc5884d77d))
26+
* **internal:** codegen related update ([99b8089](https://github.com/browserbase/sdk-node/commit/99b8089de31eb102cb82a9b85b2d13fd57570f5c))
27+
* **internal:** reduce CI branch coverage ([37d8e14](https://github.com/browserbase/sdk-node/commit/37d8e1406cc38d5e2003f40b43a7632c7f528544))
28+
* **internal:** upload builds and expand CI branch coverage ([d30a38a](https://github.com/browserbase/sdk-node/commit/d30a38a6331169eb4ef7672ae6fbd561cd5c5b0c))
29+
30+
31+
### Documentation
32+
33+
* **readme:** fix typo ([7bc4b9b](https://github.com/browserbase/sdk-node/commit/7bc4b9ba006fef118f7883ed2fab7cc140906f97))
34+
335
## 2.5.0 (2025-03-28)
436

537
Full Changelog: [v2.4.0...v2.5.0](https://github.com/browserbase/sdk-node/compare/v2.4.0...v2.5.0)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ async function main() {
110110
main();
111111
```
112112

113-
Error codes are as followed:
113+
Error codes are as follows:
114114

115115
| Status Code | Error Type |
116116
| ----------- | -------------------------- |

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@browserbasehq/sdk",
3-
"version": "2.5.0",
3+
"version": "2.6.0",
44
"description": "The official Node.js library for the Browserbase API",
55
"author": "Browserbase <[email protected]>",
66
"types": "dist/index.d.ts",

scripts/utils/upload-artifact.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
set -exuo pipefail
3+
4+
RESPONSE=$(curl -X POST "$URL" \
5+
-H "Authorization: Bearer $AUTH" \
6+
-H "Content-Type: application/json")
7+
8+
SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url')
9+
10+
if [[ "$SIGNED_URL" == "null" ]]; then
11+
echo -e "\033[31mFailed to get signed URL.\033[0m"
12+
exit 1
13+
fi
14+
15+
UPLOAD_RESPONSE=$(tar -cz dist | curl -v -X PUT \
16+
-H "Content-Type: application/gzip" \
17+
--data-binary @- "$SIGNED_URL" 2>&1)
18+
19+
if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
20+
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
21+
echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/browserbase-node/$SHA'\033[0m"
22+
else
23+
echo -e "\033[31mFailed to upload artifact.\033[0m"
24+
exit 1
25+
fi

src/core.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,20 @@ export {
3333

3434
export type Fetch = (url: RequestInfo, init?: RequestInit) => Promise<Response>;
3535

36+
/**
37+
* An alias to the builtin `Array` type so we can
38+
* easily alias it in import statements if there are name clashes.
39+
*/
40+
type _Array<T> = Array<T>;
41+
42+
/**
43+
* An alias to the builtin `Record` type so we can
44+
* easily alias it in import statements if there are name clashes.
45+
*/
46+
type _Record<K extends keyof any, T> = Record<K, T>;
47+
48+
export type { _Array as Array, _Record as Record };
49+
3650
type PromiseOrValue<T> = T | Promise<T>;
3751

3852
type APIResponseProps = {
@@ -282,10 +296,10 @@ export abstract class APIClient {
282296
}
283297

284298
buildRequest<Req>(
285-
options: FinalRequestOptions<Req>,
299+
inputOptions: FinalRequestOptions<Req>,
286300
{ retryCount = 0 }: { retryCount?: number } = {},
287301
): { req: RequestInit; url: string; timeout: number } {
288-
options = { ...options };
302+
const options = { ...inputOptions };
289303
const { method, path, query, headers: headers = {} } = options;
290304

291305
const body =
@@ -313,8 +327,8 @@ export abstract class APIClient {
313327
}
314328

315329
if (this.idempotencyHeader && method !== 'get') {
316-
if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey();
317-
headers[this.idempotencyHeader] = options.idempotencyKey;
330+
if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey();
331+
headers[this.idempotencyHeader] = inputOptions.idempotencyKey;
318332
}
319333

320334
const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount });
@@ -371,7 +385,7 @@ export abstract class APIClient {
371385
getHeader(headers, 'x-stainless-timeout') === undefined &&
372386
options.timeout
373387
) {
374-
reqHeaders['x-stainless-timeout'] = String(options.timeout);
388+
reqHeaders['x-stainless-timeout'] = String(Math.trunc(options.timeout / 1000));
375389
}
376390

377391
this.validateHeaders(reqHeaders, headers);

src/resources/sessions/sessions.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,8 @@ export interface SessionCreateParams {
307307
extensionId?: string;
308308

309309
/**
310-
* Set to true to keep the session alive even after disconnections. This is
311-
* available on the Startup plan only.
310+
* Set to true to keep the session alive even after disconnections. Available on
311+
* the Hobby Plan and above.
312312
*/
313313
keepAlive?: boolean;
314314

@@ -350,6 +350,18 @@ export namespace SessionCreateParams {
350350
*/
351351
blockAds?: boolean;
352352

353+
/**
354+
* Custom selector for captcha image. See
355+
* [Custom Captcha Solving](/features/stealth-mode#custom-captcha-solving)
356+
*/
357+
captchaImageSelector?: string;
358+
359+
/**
360+
* Custom selector for captcha input. See
361+
* [Custom Captcha Solving](/features/stealth-mode#custom-captcha-solving)
362+
*/
363+
captchaInputSelector?: string;
364+
353365
context?: BrowserSettings.Context;
354366

355367
/**

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = '2.5.0'; // x-release-please-version
1+
export const VERSION = '2.6.0'; // x-release-please-version

tests/api-resources/sessions/sessions.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ describe('resource sessions', () => {
2626
browserSettings: {
2727
advancedStealth: true,
2828
blockAds: true,
29+
captchaImageSelector: 'captchaImageSelector',
30+
captchaInputSelector: 'captchaInputSelector',
2931
context: { id: 'id', persist: true },
3032
extensionId: 'extensionId',
3133
fingerprint: {

0 commit comments

Comments
 (0)