Skip to content

release: 2.7.0 #166

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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
690777f
chore(internal): version bump
stainless-app[bot] May 16, 2025
985f2fe
chore(docs): grammar improvements
stainless-app[bot] May 22, 2025
88ce3e3
chore: improve publish-npm script --latest tag logic
stainless-app[bot] May 28, 2025
b2cca2c
codegen metadata
stainless-app[bot] Jun 3, 2025
24c7006
chore(docs): use top-level-await in example snippets
stainless-app[bot] Jun 4, 2025
87c245e
fix: publish script — handle NPM errors correctly
stainless-app[bot] Jun 14, 2025
6ec9d38
chore(internal): make base APIResource abstract
stainless-app[bot] Jun 14, 2025
0c69436
feat(client): add support for endpoint-specific base URLs
stainless-app[bot] Jun 17, 2025
132825d
chore(ci): enable for pull requests
stainless-app[bot] Jun 17, 2025
3e0bfd3
refactor(types): replace Record with mapped types
stainless-app[bot] Jun 24, 2025
8e59beb
fix(ci): release-doctor — report correct token name
stainless-app[bot] Jun 27, 2025
a166050
chore(ci): only run for pushes and fork pull requests
stainless-app[bot] Jun 28, 2025
0a36097
codegen metadata
stainless-app[bot] Jun 30, 2025
ef5f62b
feat(api): api update
stainless-app[bot] Jul 2, 2025
8d864d1
chore: mention unit type in timeout docs
stainless-app[bot] Jul 3, 2025
bfe46e8
fix(client): don't send `Content-Type` for bodyless methods
stainless-app[bot] Jul 3, 2025
9a02a7d
codegen metadata
stainless-app[bot] Jul 3, 2025
f8111cb
chore: make some internal functions async
stainless-app[bot] Jul 10, 2025
0ec3383
feat(api): api update
stainless-app[bot] Jul 10, 2025
0efabac
feat(mcp): support filtering tool results by a jq expression
stainless-app[bot] Jul 11, 2025
ed8cb1e
release: 2.7.0
stainless-app[bot] Jul 11, 2025
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
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ on:
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

Expand All @@ -31,6 +36,7 @@ jobs:
timeout-minutes: 5
name: build
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
permissions:
contents: read
id-token: write
Expand Down Expand Up @@ -66,6 +72,7 @@ jobs:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

Expand Down
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.6.0"
".": "2.7.0"
}
6 changes: 3 additions & 3 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-e2ed1b5267eeff92982918505349017b9155da2c7ab948787ab11cf9068af1b8.yml
openapi_spec_hash: 6639c21dccb52ca610cae833227a9791
config_hash: 74882e23a455dece33e43a27e67f0fbb
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-219341ea9864a23d33fbb51843fd6f762f41ec8be5154bd963bfceff0bc30bb1.yml
openapi_spec_hash: 43fdb5f9ab7c52a17206c881128afb45
config_hash: b3ca4ec5b02e5333af51ebc2e9fdef1b
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Changelog

## 2.7.0 (2025-07-11)

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

### Features

* **api:** api update ([0ec3383](https://github.com/browserbase/sdk-node/commit/0ec33838237efd4424249482aac57294f17bdeda))
* **api:** api update ([ef5f62b](https://github.com/browserbase/sdk-node/commit/ef5f62b267edcfa58fb677db40ae24a9a742ffa0))
* **client:** add support for endpoint-specific base URLs ([0c69436](https://github.com/browserbase/sdk-node/commit/0c69436d731785b207af5f979e9eb5ae1b975957))
* **mcp:** support filtering tool results by a jq expression ([0efabac](https://github.com/browserbase/sdk-node/commit/0efabac130794ebc44c4054a19e77bb6fc455749))


### Bug Fixes

* **ci:** release-doctor — report correct token name ([8e59beb](https://github.com/browserbase/sdk-node/commit/8e59beb314e8c07bd14b471121e28ec941168190))
* **client:** don't send `Content-Type` for bodyless methods ([bfe46e8](https://github.com/browserbase/sdk-node/commit/bfe46e8c3af3377953857072ee39babdaec25820))
* publish script — handle NPM errors correctly ([87c245e](https://github.com/browserbase/sdk-node/commit/87c245e2048dad1586d97fae8c4622c6e2780365))


### Chores

* **ci:** enable for pull requests ([132825d](https://github.com/browserbase/sdk-node/commit/132825d5c65ba9aa1c47afe9b8a7b14885129598))
* **ci:** only run for pushes and fork pull requests ([a166050](https://github.com/browserbase/sdk-node/commit/a166050ab35ddff365ca60f23ed1243690b7eda2))
* **docs:** grammar improvements ([985f2fe](https://github.com/browserbase/sdk-node/commit/985f2fe1bf866f1dc48c8d5f1827dda2e99b6f11))
* **docs:** use top-level-await in example snippets ([24c7006](https://github.com/browserbase/sdk-node/commit/24c7006ca4c4dc7c03a48796b2677bdc47728934))
* improve publish-npm script --latest tag logic ([88ce3e3](https://github.com/browserbase/sdk-node/commit/88ce3e3a96e34bfeb08d2ac254440b283818d7ef))
* **internal:** make base APIResource abstract ([6ec9d38](https://github.com/browserbase/sdk-node/commit/6ec9d38a92775cb8e46468b05f539f53a01b54c9))
* **internal:** version bump ([690777f](https://github.com/browserbase/sdk-node/commit/690777f5b88d363db563aba093363ed84c7c9ec4))
* make some internal functions async ([f8111cb](https://github.com/browserbase/sdk-node/commit/f8111cb415bd62ff7d30f6ec7912878042d94eed))
* mention unit type in timeout docs ([8d864d1](https://github.com/browserbase/sdk-node/commit/8d864d1f6858a655840ec824434e045c886216eb))


### Refactors

* **types:** replace Record with mapped types ([3e0bfd3](https://github.com/browserbase/sdk-node/commit/3e0bfd327332edd2969106d189e650286d13e441))

## 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)
Expand Down
38 changes: 13 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,9 @@ const client = new Browserbase({
apiKey: process.env['BROWSERBASE_API_KEY'], // This is the default and can be omitted
});

async function main() {
const session = await client.sessions.create({ projectId: 'your_project_id' });
const session = await client.sessions.create({ projectId: 'your_project_id' });

console.log(session.id);
}

main();
console.log(session.id);
```

### Request & Response types
Expand All @@ -47,12 +43,8 @@ const client = new Browserbase({
apiKey: process.env['BROWSERBASE_API_KEY'], // This is the default and can be omitted
});

async function main() {
const params: Browserbase.SessionCreateParams = { projectId: 'your_project_id' };
const session: Browserbase.SessionCreateResponse = await client.sessions.create(params);
}

main();
const params: Browserbase.SessionCreateParams = { projectId: 'your_project_id' };
const session: Browserbase.SessionCreateResponse = await client.sessions.create(params);
```

Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
Expand Down Expand Up @@ -95,19 +87,15 @@ a subclass of `APIError` will be thrown:

<!-- prettier-ignore -->
```ts
async function main() {
const session = await client.sessions.create({ projectId: 'your_project_id' }).catch(async (err) => {
if (err instanceof Browserbase.APIError) {
console.log(err.status); // 400
console.log(err.name); // BadRequestError
console.log(err.headers); // {server: 'nginx', ...}
} else {
throw err;
}
});
}

main();
const session = await client.sessions.create({ projectId: 'your_project_id' }).catch(async (err) => {
if (err instanceof Browserbase.APIError) {
console.log(err.status); // 400
console.log(err.name); // BadRequestError
console.log(err.headers); // {server: 'nginx', ...}
} else {
throw err;
}
});
```

Error codes are as follows:
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ before making any information public.
## Reporting Non-SDK Related Security Issues

If you encounter security issues that are not directly related to SDKs but pertain to the services
or products provided by Browserbase please follow the respective company's security reporting guidelines.
or products provided by Browserbase, please follow the respective company's security reporting guidelines.

### Browserbase Terms and Policies

Please contact [email protected] for any questions or concerns regarding security of our services.
Please contact [email protected] for any questions or concerns regarding the security of our services.

---

Expand Down
29 changes: 14 additions & 15 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,60 @@

Types:

- <code><a href="./src/resources/contexts.ts">Context</a></code>
- <code><a href="./src/resources/contexts.ts">ContextCreateResponse</a></code>
- <code><a href="./src/resources/contexts.ts">ContextRetrieveResponse</a></code>
- <code><a href="./src/resources/contexts.ts">ContextUpdateResponse</a></code>

Methods:

- <code title="post /v1/contexts">client.contexts.<a href="./src/resources/contexts.ts">create</a>({ ...params }) -> ContextCreateResponse</code>
- <code title="get /v1/contexts/{id}">client.contexts.<a href="./src/resources/contexts.ts">retrieve</a>(id) -> Context</code>
- <code title="get /v1/contexts/{id}">client.contexts.<a href="./src/resources/contexts.ts">retrieve</a>(id) -> ContextRetrieveResponse</code>
- <code title="put /v1/contexts/{id}">client.contexts.<a href="./src/resources/contexts.ts">update</a>(id) -> ContextUpdateResponse</code>

# Extensions

Types:

- <code><a href="./src/resources/extensions.ts">Extension</a></code>
- <code><a href="./src/resources/extensions.ts">ExtensionCreateResponse</a></code>
- <code><a href="./src/resources/extensions.ts">ExtensionRetrieveResponse</a></code>

Methods:

- <code title="post /v1/extensions">client.extensions.<a href="./src/resources/extensions.ts">create</a>({ ...params }) -> Extension</code>
- <code title="get /v1/extensions/{id}">client.extensions.<a href="./src/resources/extensions.ts">retrieve</a>(id) -> Extension</code>
- <code title="post /v1/extensions">client.extensions.<a href="./src/resources/extensions.ts">create</a>({ ...params }) -> ExtensionCreateResponse</code>
- <code title="get /v1/extensions/{id}">client.extensions.<a href="./src/resources/extensions.ts">retrieve</a>(id) -> ExtensionRetrieveResponse</code>
- <code title="delete /v1/extensions/{id}">client.extensions.<a href="./src/resources/extensions.ts">delete</a>(id) -> void</code>

# Projects

Types:

- <code><a href="./src/resources/projects.ts">Project</a></code>
- <code><a href="./src/resources/projects.ts">ProjectUsage</a></code>
- <code><a href="./src/resources/projects.ts">ProjectRetrieveResponse</a></code>
- <code><a href="./src/resources/projects.ts">ProjectListResponse</a></code>
- <code><a href="./src/resources/projects.ts">ProjectUsageResponse</a></code>

Methods:

- <code title="get /v1/projects/{id}">client.projects.<a href="./src/resources/projects.ts">retrieve</a>(id) -> Project</code>
- <code title="get /v1/projects/{id}">client.projects.<a href="./src/resources/projects.ts">retrieve</a>(id) -> ProjectRetrieveResponse</code>
- <code title="get /v1/projects">client.projects.<a href="./src/resources/projects.ts">list</a>() -> ProjectListResponse</code>
- <code title="get /v1/projects/{id}/usage">client.projects.<a href="./src/resources/projects.ts">usage</a>(id) -> ProjectUsage</code>
- <code title="get /v1/projects/{id}/usage">client.projects.<a href="./src/resources/projects.ts">usage</a>(id) -> ProjectUsageResponse</code>

# Sessions

Types:

- <code><a href="./src/resources/sessions/sessions.ts">Session</a></code>
- <code><a href="./src/resources/sessions/sessions.ts">SessionLiveURLs</a></code>
- <code><a href="./src/resources/sessions/sessions.ts">SessionCreateResponse</a></code>
- <code><a href="./src/resources/sessions/sessions.ts">SessionRetrieveResponse</a></code>
- <code><a href="./src/resources/sessions/sessions.ts">SessionUpdateResponse</a></code>
- <code><a href="./src/resources/sessions/sessions.ts">SessionListResponse</a></code>
- <code><a href="./src/resources/sessions/sessions.ts">SessionDebugResponse</a></code>

Methods:

- <code title="post /v1/sessions">client.sessions.<a href="./src/resources/sessions/sessions.ts">create</a>({ ...params }) -> SessionCreateResponse</code>
- <code title="get /v1/sessions/{id}">client.sessions.<a href="./src/resources/sessions/sessions.ts">retrieve</a>(id) -> SessionRetrieveResponse</code>
- <code title="post /v1/sessions/{id}">client.sessions.<a href="./src/resources/sessions/sessions.ts">update</a>(id, { ...params }) -> Session</code>
- <code title="post /v1/sessions/{id}">client.sessions.<a href="./src/resources/sessions/sessions.ts">update</a>(id, { ...params }) -> SessionUpdateResponse</code>
- <code title="get /v1/sessions">client.sessions.<a href="./src/resources/sessions/sessions.ts">list</a>({ ...params }) -> SessionListResponse</code>
- <code title="get /v1/sessions/{id}/debug">client.sessions.<a href="./src/resources/sessions/sessions.ts">debug</a>(id) -> SessionLiveURLs</code>
- <code title="get /v1/sessions/{id}/debug">client.sessions.<a href="./src/resources/sessions/sessions.ts">debug</a>(id) -> SessionDebugResponse</code>

## Downloads

Expand All @@ -66,7 +67,6 @@ Methods:

Types:

- <code><a href="./src/resources/sessions/logs.ts">SessionLog</a></code>
- <code><a href="./src/resources/sessions/logs.ts">LogListResponse</a></code>

Methods:
Expand All @@ -77,7 +77,6 @@ Methods:

Types:

- <code><a href="./src/resources/sessions/recording.ts">SessionRecording</a></code>
- <code><a href="./src/resources/sessions/recording.ts">RecordingRetrieveResponse</a></code>

Methods:
Expand Down
2 changes: 1 addition & 1 deletion bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
errors=()

if [ -z "${NPM_TOKEN}" ]; then
errors+=("The BROWSERBASE_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi

lenErrors=${#errors[@]}
Expand Down
52 changes: 44 additions & 8 deletions bin/publish-npm
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,55 @@ set -eux

npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"

# Build the project
yarn build

# Navigate to the dist directory
cd dist

# Get the version from package.json
VERSION="$(node -p "require('./package.json').version")"
# Get package name and version from package.json
PACKAGE_NAME="$(jq -r -e '.name' ./package.json)"
VERSION="$(jq -r -e '.version' ./package.json)"

# Get latest version from npm
#
# If the package doesn't exist, npm will return:
# {
# "error": {
# "code": "E404",
# "summary": "Unpublished on 2025-06-05T09:54:53.528Z",
# "detail": "'the_package' is not in this registry..."
# }
# }
NPM_INFO="$(npm view "$PACKAGE_NAME" version --json 2>/dev/null || true)"

# Check if we got an E404 error
if echo "$NPM_INFO" | jq -e '.error.code == "E404"' > /dev/null 2>&1; then
# Package doesn't exist yet, no last version
LAST_VERSION=""
elif echo "$NPM_INFO" | jq -e '.error' > /dev/null 2>&1; then
# Report other errors
echo "ERROR: npm returned unexpected data:"
echo "$NPM_INFO"
exit 1
else
# Success - get the version
LAST_VERSION=$(echo "$NPM_INFO" | jq -r '.') # strip quotes
fi

# Extract the pre-release tag if it exists
# Check if current version is pre-release (e.g. alpha / beta / rc)
CURRENT_IS_PRERELEASE=false
if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then
# Extract the part before any dot in the pre-release identifier
TAG="${BASH_REMATCH[1]}"
CURRENT_IS_PRERELEASE=true
CURRENT_TAG="${BASH_REMATCH[1]}"
fi

# Check if last version is a stable release
LAST_IS_STABLE_RELEASE=true
if [[ -z "$LAST_VERSION" || "$LAST_VERSION" =~ -([a-zA-Z]+) ]]; then
LAST_IS_STABLE_RELEASE=false
fi

# Use a corresponding alpha/beta tag if there already is a stable release and we're publishing a prerelease.
if $CURRENT_IS_PRERELEASE && $LAST_IS_STABLE_RELEASE; then
TAG="$CURRENT_TAG"
else
TAG="latest"
fi
Expand Down
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.6.0",
"version": "2.7.0",
"description": "The official Node.js library for the Browserbase API",
"author": "Browserbase <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fi
node scripts/utils/make-dist-package-json.cjs > dist/package.json

# build to .js/.mjs/.d.ts files
npm exec tsc-multi
./node_modules/.bin/tsc-multi
# copy over handwritten .js/.mjs/.d.ts files
cp src/_shims/*.{d.ts,js,mjs,md} dist/_shims
cp src/_shims/auto/*.{d.ts,js,mjs} dist/_shims/auto
Expand Down
Loading