Skip to content

release: 2.6.0 #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
42 changes: 30 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
- next
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ubuntu-latest

runs-on: ${{ github.repository == 'stainless-sdks/browserbase-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4

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

build:
timeout-minutes: 5
name: build
runs-on: ubuntu-latest

runs-on: ${{ github.repository == 'stainless-sdks/browserbase-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4

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

- name: Check build
run: ./scripts/build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/browserbase-node'
id: github-oidc
uses: actions/github-script@v6
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/browserbase-node'
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
SHA: ${{ github.sha }}
run: ./scripts/utils/upload-artifact.sh
test:
timeout-minutes: 10
name: test
runs-on: ubuntu-latest

runs-on: ${{ github.repository == 'stainless-sdks/browserbase-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4

2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.5.0"
".": "2.6.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 18
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-ad8e080c2347b3f28d64f49cf02c2ab4a69b7bf289fd7eb018c955d8915bb990.yml
openapi_spec_hash: b3aea10135a89597634d62f1ef418839
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-e2ed1b5267eeff92982918505349017b9155da2c7ab948787ab11cf9068af1b8.yml
openapi_spec_hash: 6639c21dccb52ca610cae833227a9791
config_hash: 74882e23a455dece33e43a27e67f0fbb
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Changelog

## 2.6.0 (2025-05-16)

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

### Features

* **api:** api update ([0b43bac](https://github.com/browserbase/sdk-node/commit/0b43baccf8dbb13ed4b9bb8feed15849007cc531))
* **api:** api update ([#158](https://github.com/browserbase/sdk-node/issues/158)) ([1287216](https://github.com/browserbase/sdk-node/commit/12872160a6e7be94d82cb4189cf53dc9eecbfbba))


### Bug Fixes

* **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))
* **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))
* **mcp:** remove unused tools.ts ([#164](https://github.com/browserbase/sdk-node/issues/164)) ([b09bd54](https://github.com/browserbase/sdk-node/commit/b09bd54af116847e852f67bf6c7f0e32dfa92509))


### Chores

* **ci:** add timeout thresholds for CI jobs ([c813b38](https://github.com/browserbase/sdk-node/commit/c813b38b3be8470e2c5b95b58c621ccd7b7ccfe5))
* **ci:** only use depot for staging repos ([475fe50](https://github.com/browserbase/sdk-node/commit/475fe5018be88d96971697bdc3e1b33ae9669310))
* **client:** minor internal fixes ([ee36919](https://github.com/browserbase/sdk-node/commit/ee369190b385d25726cac1e3bc0e23559539d8d9))
* **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))
* **internal:** codegen related update ([99b8089](https://github.com/browserbase/sdk-node/commit/99b8089de31eb102cb82a9b85b2d13fd57570f5c))
* **internal:** reduce CI branch coverage ([37d8e14](https://github.com/browserbase/sdk-node/commit/37d8e1406cc38d5e2003f40b43a7632c7f528544))
* **internal:** upload builds and expand CI branch coverage ([d30a38a](https://github.com/browserbase/sdk-node/commit/d30a38a6331169eb4ef7672ae6fbd561cd5c5b0c))


### Documentation

* **readme:** fix typo ([7bc4b9b](https://github.com/browserbase/sdk-node/commit/7bc4b9ba006fef118f7883ed2fab7cc140906f97))

## 2.5.0 (2025-03-28)

Full Changelog: [v2.4.0...v2.5.0](https://github.com/browserbase/sdk-node/compare/v2.4.0...v2.5.0)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@ async function main() {
main();
```

Error codes are as followed:
Error codes are as follows:

| Status Code | Error Type |
| ----------- | -------------------------- |
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@browserbasehq/sdk",
"version": "2.5.0",
"version": "2.6.0",
"description": "The official Node.js library for the Browserbase API",
"author": "Browserbase <[email protected]>",
"types": "dist/index.d.ts",
25 changes: 25 additions & 0 deletions scripts/utils/upload-artifact.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -exuo pipefail

RESPONSE=$(curl -X POST "$URL" \
-H "Authorization: Bearer $AUTH" \
-H "Content-Type: application/json")

SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url')

if [[ "$SIGNED_URL" == "null" ]]; then
echo -e "\033[31mFailed to get signed URL.\033[0m"
exit 1
fi

UPLOAD_RESPONSE=$(tar -cz dist | curl -v -X PUT \
-H "Content-Type: application/gzip" \
--data-binary @- "$SIGNED_URL" 2>&1)

if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/browserbase-node/$SHA'\033[0m"
else
echo -e "\033[31mFailed to upload artifact.\033[0m"
exit 1
fi
24 changes: 19 additions & 5 deletions src/core.ts
Original file line number Diff line number Diff line change
@@ -33,6 +33,20 @@ export {

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

/**
* An alias to the builtin `Array` type so we can
* easily alias it in import statements if there are name clashes.
*/
type _Array<T> = Array<T>;

/**
* An alias to the builtin `Record` type so we can
* easily alias it in import statements if there are name clashes.
*/
type _Record<K extends keyof any, T> = Record<K, T>;

export type { _Array as Array, _Record as Record };

type PromiseOrValue<T> = T | Promise<T>;

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

buildRequest<Req>(
options: FinalRequestOptions<Req>,
inputOptions: FinalRequestOptions<Req>,
{ retryCount = 0 }: { retryCount?: number } = {},
): { req: RequestInit; url: string; timeout: number } {
options = { ...options };
const options = { ...inputOptions };
const { method, path, query, headers: headers = {} } = options;

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

if (this.idempotencyHeader && method !== 'get') {
if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey();
headers[this.idempotencyHeader] = options.idempotencyKey;
if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey();
headers[this.idempotencyHeader] = inputOptions.idempotencyKey;
}

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

this.validateHeaders(reqHeaders, headers);
16 changes: 14 additions & 2 deletions src/resources/sessions/sessions.ts
Original file line number Diff line number Diff line change
@@ -307,8 +307,8 @@ export interface SessionCreateParams {
extensionId?: string;

/**
* Set to true to keep the session alive even after disconnections. This is
* available on the Startup plan only.
* Set to true to keep the session alive even after disconnections. Available on
* the Hobby Plan and above.
*/
keepAlive?: boolean;

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

/**
* Custom selector for captcha image. See
* [Custom Captcha Solving](/features/stealth-mode#custom-captcha-solving)
*/
captchaImageSelector?: string;

/**
* Custom selector for captcha input. See
* [Custom Captcha Solving](/features/stealth-mode#custom-captcha-solving)
*/
captchaInputSelector?: string;

context?: BrowserSettings.Context;

/**
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '2.5.0'; // x-release-please-version
export const VERSION = '2.6.0'; // x-release-please-version
2 changes: 2 additions & 0 deletions tests/api-resources/sessions/sessions.test.ts
Original file line number Diff line number Diff line change
@@ -26,6 +26,8 @@ describe('resource sessions', () => {
browserSettings: {
advancedStealth: true,
blockAds: true,
captchaImageSelector: 'captchaImageSelector',
captchaInputSelector: 'captchaInputSelector',
context: { id: 'id', persist: true },
extensionId: 'extensionId',
fingerprint: {