Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand All @@ -37,7 +37,7 @@ jobs:
build:
timeout-minutes: 5
name: build
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
permissions:
contents: read
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
test:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
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.16.0"
".": "2.17.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: 38
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/browserbase-98cc68ad9afa71355baf2b31f305a5e2f3a315fd311c96659405eff96b8f2b1e.yml
openapi_spec_hash: 71dfbc1021a33dd7fc9d82844965b1b3
config_hash: 6209a285dd5980f5c418fe6575723aef
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/browserbase-99c716f954a37900a19a0dc8465d6f502b1df7a0a2a2fde1eaaadac2b749f546.yml
openapi_spec_hash: c060ef2eebd323545d2ad60dad505cf1
config_hash: 12a5eb5ac818623045ae77075ee3dd53
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 2.17.0 (2026-08-04)

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

### Features

* [CORE-2365] Add optional name to create and get Context API ([5d0b67a](https://github.com/browserbase/sdk-node/commit/5d0b67aa2087c089952cdf63318f2cb30d4e2592))
* [STG-2717] Pass-thru `proxy` config for session creation in `/v1/agents/runs` ([428168e](https://github.com/browserbase/sdk-node/commit/428168eb7cd5b08ac53fe8ad28f3f4d0c3b592eb))
* name session-create timeout param for SDK codegen ([78f6fab](https://github.com/browserbase/sdk-node/commit/78f6fab50f0e4998f06a3e9e303a7a85663e8089))
* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([27b689b](https://github.com/browserbase/sdk-node/commit/27b689b3998e15cbe654f0fc90e1e9c3aecc5899))

## 2.16.0 (2026-07-14)

Full Changelog: [v2.15.0...v2.16.0](https://github.com/browserbase/sdk-node/compare/v2.15.0...v2.16.0)
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.16.0",
"version": "2.17.0",
"description": "The official Node.js library for the Browserbase API",
"author": "Browserbase <support@browserbase.com>",
"license": "Apache-2.0",
Expand Down
93 changes: 91 additions & 2 deletions src/resources/agents/runs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,16 @@ export namespace RunCreateParams {
context?: BrowserSettings.Context;

/**
* Set true to route the agent's browser session through the default proxy.
* Proxy configuration. Can be true for default proxy, or an array of proxy
* configurations.
*/
proxies?: boolean;
proxies?:
| Array<
| BrowserSettings.BrowserbaseProxyConfig
| BrowserSettings.ExternalProxyConfig
| BrowserSettings.NoneProxyConfig
>
| boolean;

/**
* Set true to enable Browserbase Verified for the session.
Expand All @@ -462,6 +469,88 @@ export namespace RunCreateParams {
*/
persist?: boolean;
}

export interface BrowserbaseProxyConfig {
/**
* Type of proxy. Always use 'browserbase' for the Browserbase managed proxy
* network.
*/
type: 'browserbase';

/**
* Domain pattern for which this proxy should be used. If omitted, defaults to all
* domains. Optional.
*/
domainPattern?: string;

/**
* Geographic location for the proxy. Optional.
*/
geolocation?: BrowserbaseProxyConfig.Geolocation;
}

export namespace BrowserbaseProxyConfig {
/**
* Geographic location for the proxy. Optional.
*/
export interface Geolocation {
/**
* Country code in ISO 3166-1 alpha-2 format
*/
country: string;

/**
* Name of the city. Use spaces for multi-word city names. Optional.
*/
city?: string;

/**
* US state code (2 characters). Must also specify US as the country. Optional.
*/
state?: string;
}
}

export interface ExternalProxyConfig {
/**
* Server URL for external proxy. Required.
*/
server: string;

/**
* Type of proxy. Always 'external' for this config.
*/
type: 'external';

/**
* Domain pattern for which this proxy should be used. If omitted, defaults to all
* domains. Optional.
*/
domainPattern?: string;

/**
* Password for external proxy authentication. Optional.
*/
password?: string;

/**
* Username for external proxy authentication. Optional.
*/
username?: string;
}

export interface NoneProxyConfig {
/**
* Type of proxy. Always 'none' for this config.
*/
type: 'none';

/**
* Domain pattern for which this proxy should be used. If omitted, defaults to all
* domains. Optional.
*/
domainPattern?: string;
}
}

export interface Variables {
Expand Down
14 changes: 14 additions & 0 deletions src/resources/contexts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ export interface Context {
projectId: string;

updatedAt: string;

/**
* Optional user-defined name for the Context. Leading and trailing whitespace is
* trimmed before storage. Names are unique within the project among active
* Contexts, compared case-insensitively.
*/
name?: string;
}

export interface ContextCreateResponse {
Expand Down Expand Up @@ -111,6 +118,13 @@ export interface ContextUpdateResponse {
}

export interface ContextCreateParams {
/**
* Optional user-defined name for the Context. Leading and trailing whitespace is
* trimmed before storage. Names are unique within the project among active
* Contexts, compared case-insensitively.
*/
name?: string;

/**
* The Project ID. Can be found in
* [Settings](https://www.browserbase.com/settings). Optional - if not provided,
Expand Down
13 changes: 7 additions & 6 deletions src/resources/sessions/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ export class Sessions extends APIResource {
/**
* Create a Session
*/
create(body?: SessionCreateParams, options?: Core.RequestOptions): Core.APIPromise<SessionCreateResponse>;
create(params?: SessionCreateParams, options?: Core.RequestOptions): Core.APIPromise<SessionCreateResponse>;
create(options?: Core.RequestOptions): Core.APIPromise<SessionCreateResponse>;
create(
body: SessionCreateParams | Core.RequestOptions = {},
params: SessionCreateParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<SessionCreateResponse> {
if (isRequestOptions(body)) {
return this.create({}, body);
if (isRequestOptions(params)) {
return this.create({}, params);
}
return this._client.post('/v1/sessions', { body, ...options });
const { api_timeout, ...body } = params;
return this._client.post('/v1/sessions', { body: { timeout: api_timeout, ...body }, ...options });
}

/**
Expand Down Expand Up @@ -230,7 +231,7 @@ export interface SessionCreateParams {
* Duration in seconds after which the session will automatically end. Defaults to
* the Project's `defaultTimeout`.
*/
timeout?: number;
api_timeout?: number;

/**
* Arbitrary user metadata to attach to the session. To learn more about user
Expand Down
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.16.0'; // x-release-please-version
export const VERSION = '2.17.0'; // x-release-please-version
12 changes: 11 additions & 1 deletion tests/api-resources/agents/runs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@ describe('resource runs', () => {
agentId: 'agentId',
browserSettings: {
context: { id: 'id', persist: true },
proxies: true,
proxies: [
{
type: 'browserbase',
domainPattern: 'domainPattern',
geolocation: {
country: 'xx',
city: 'city',
state: 'xx',
},
},
],
verified: true,
},
resultSchema: { foo: 'bar' },
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/contexts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('resource contexts', () => {
test('create: request options and params are passed correctly', async () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
client.contexts.create({ projectId: 'projectId' }, { path: '/_stainless_unknown_path' }),
client.contexts.create({ name: 'x', projectId: 'projectId' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Browserbase.NotFoundError);
});

Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/sessions/sessions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('resource sessions', () => {
],
proxySettings: { caCertificates: ['182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'] },
region: 'us-west-2',
timeout: 60,
api_timeout: 60,
userMetadata: { foo: 'bar' },
},
{ path: '/_stainless_unknown_path' },
Expand Down
Loading