Skip to content
Merged
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
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.15.0"
".": "2.16.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 36
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/browserbase-e82c289d3d3aabd936a476cf81630587ffe46ab9e9bdebced4b31b8c2f9bc08f.yml
openapi_spec_hash: 473121b283812a3dfd866afe9b61dc7d
config_hash: 1b24ea9fa13645b16b74aa794dbc8190
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 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)

### Features

* **api:** manual updates ([036d917](https://github.com/browserbase/sdk-node/commit/036d917c294fb56c387abcb05ea1dc66db1c83f2))

## 2.15.0 (2026-07-02)

Full Changelog: [v2.14.1...v2.15.0](https://github.com/browserbase/sdk-node/compare/v2.14.1...v2.15.0)
Expand Down
19 changes: 16 additions & 3 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,25 @@ Methods:

Types:

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

Methods:

- <code title="get /v1/sessions/{id}/recording">client.sessions.recording.<a href="./src/resources/sessions/recording.ts">retrieve</a>(id) -> RecordingRetrieveResponse</code>
- <code title="get /v1/sessions/{id}/recording">client.sessions.recording.<a href="./src/resources/sessions/recording/recording.ts">retrieve</a>(id) -> RecordingRetrieveResponse</code>

### Downloads

Types:

- <code><a href="./src/resources/sessions/recording/downloads.ts">RecordingDownload</a></code>
- <code><a href="./src/resources/sessions/recording/downloads.ts">DownloadCreateResponse</a></code>
- <code><a href="./src/resources/sessions/recording/downloads.ts">DownloadListResponse</a></code>

Methods:

- <code title="post /v1/sessions/{id}/recording/downloads">client.sessions.recording.downloads.<a href="./src/resources/sessions/recording/downloads.ts">create</a>(id) -> DownloadCreateResponse</code>
- <code title="get /v1/sessions/{id}/recording/downloads">client.sessions.recording.downloads.<a href="./src/resources/sessions/recording/downloads.ts">list</a>(id) -> DownloadListResponse</code>

## Uploads

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.15.0",
"version": "2.16.0",
"description": "The official Node.js library for the Browserbase API",
"author": "Browserbase <support@browserbase.com>",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/resources/sessions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export { Downloads } from './downloads';
export { Logs, type SessionLog, type LogListResponse } from './logs';
export { Recording, type SessionRecording, type RecordingRetrieveResponse } from './recording';
export { Recording, type SessionRecording, type RecordingRetrieveResponse } from './recording/index';
export { Replays, type ReplayRetrieveResponse } from './replays';
export {
Sessions,
Expand Down
38 changes: 1 addition & 37 deletions src/resources/sessions/recording.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,3 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../../resource';
import * as Core from '../../core';

export class Recording extends APIResource {
/**
* Session Recording
*/
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<RecordingRetrieveResponse> {
return this._client.get(`/v1/sessions/${id}/recording`, options);
}
}

export interface SessionRecording {
/**
* See
* [rrweb documentation](https://github.com/rrweb-io/rrweb/blob/master/docs/recipes/dive-into-event.md).
*/
data: { [key: string]: unknown };

sessionId: string;

/**
* milliseconds that have elapsed since the UNIX epoch
*/
timestamp: number;

type: number;
}

export type RecordingRetrieveResponse = Array<SessionRecording>;

export declare namespace Recording {
export {
type SessionRecording as SessionRecording,
type RecordingRetrieveResponse as RecordingRetrieveResponse,
};
}
export * from './recording/index';
66 changes: 66 additions & 0 deletions src/resources/sessions/recording/downloads.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../../../resource';
import * as Core from '../../../core';

export class Downloads extends APIResource {
/**
* Requests one downloadable MP4 per recorded page of a session. Assembly runs
* asynchronously and every page returns as `PENDING`. Re-posting re-enqueues all
* pages and retries any that failed. Poll the GET endpoint for per-page status
* and, on standard (non-BYOS) projects, download URLs.
*/
create(id: string, options?: Core.RequestOptions): Core.APIPromise<DownloadCreateResponse> {
return this._client.post(`/v1/sessions/${id}/recording/downloads`, options);
}

/**
* Returns the per-page download status for a session, with a short-lived signed
* URL for each completed page on standard (non-BYOS) projects.
*/
list(id: string, options?: Core.RequestOptions): Core.APIPromise<DownloadListResponse> {
return this._client.get(`/v1/sessions/${id}/recording/downloads`, options);
}
}

export interface RecordingDownload {
/**
* Recorded page (tab) within the session, e.g. "0", "1".
*/
pageId: string;

/**
* Per-page MP4 assembly state. `NOT_REQUESTED`: no download has been requested for
* the session yet. `PENDING`: assembly is enqueued or in progress. `COMPLETED`:
* the MP4 is ready. `FAILED`: assembly failed; POST again to retry.
*/
status: 'NOT_REQUESTED' | 'PENDING' | 'COMPLETED' | 'FAILED';

/**
* When the MP4 was created. Present only when COMPLETED on a standard (non-BYOS)
* project.
*/
completedAt?: string;

/**
* Short-lived signed CDN URL, re-minted each GET. Present only when COMPLETED on a
* standard (non-BYOS) project.
*/
downloadUrl?: string;
}

export interface DownloadCreateResponse {
downloads: Array<RecordingDownload>;
}

export interface DownloadListResponse {
downloads: Array<RecordingDownload>;
}

export declare namespace Downloads {
export {
type RecordingDownload as RecordingDownload,
type DownloadCreateResponse as DownloadCreateResponse,
type DownloadListResponse as DownloadListResponse,
};
}
9 changes: 9 additions & 0 deletions src/resources/sessions/recording/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export {
Downloads,
type RecordingDownload,
type DownloadCreateResponse,
type DownloadListResponse,
} from './downloads';
export { Recording, type SessionRecording, type RecordingRetrieveResponse } from './recording';
52 changes: 52 additions & 0 deletions src/resources/sessions/recording/recording.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../../../resource';
import * as Core from '../../../core';
import * as DownloadsAPI from './downloads';
import { DownloadCreateResponse, DownloadListResponse, Downloads, RecordingDownload } from './downloads';

export class Recording extends APIResource {
downloads: DownloadsAPI.Downloads = new DownloadsAPI.Downloads(this._client);

/**
* Session Recording
*/
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<RecordingRetrieveResponse> {
return this._client.get(`/v1/sessions/${id}/recording`, options);
}
}

export interface SessionRecording {
/**
* See
* [rrweb documentation](https://github.com/rrweb-io/rrweb/blob/master/docs/recipes/dive-into-event.md).
*/
data: { [key: string]: unknown };

sessionId: string;

/**
* milliseconds that have elapsed since the UNIX epoch
*/
timestamp: number;

type: number;
}

export type RecordingRetrieveResponse = Array<SessionRecording>;

Recording.Downloads = Downloads;

export declare namespace Recording {
export {
type SessionRecording as SessionRecording,
type RecordingRetrieveResponse as RecordingRetrieveResponse,
};

export {
Downloads as Downloads,
type RecordingDownload as RecordingDownload,
type DownloadCreateResponse as DownloadCreateResponse,
type DownloadListResponse as DownloadListResponse,
};
}
4 changes: 2 additions & 2 deletions src/resources/sessions/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import * as DownloadsAPI from './downloads';
import { Downloads } from './downloads';
import * as LogsAPI from './logs';
import { LogListResponse, Logs, SessionLog } from './logs';
import * as RecordingAPI from './recording';
import { Recording, RecordingRetrieveResponse, SessionRecording } from './recording';
import * as ReplaysAPI from './replays';
import { ReplayRetrieveResponse, Replays } from './replays';
import * as UploadsAPI from './uploads';
import { UploadCreateParams, UploadCreateResponse, Uploads } from './uploads';
import * as RecordingAPI from './recording/recording';
import { Recording, RecordingRetrieveResponse, SessionRecording } from './recording/recording';

export class Sessions extends APIResource {
downloads: DownloadsAPI.Downloads = new DownloadsAPI.Downloads(this._client);
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.15.0'; // x-release-please-version
export const VERSION = '2.16.0'; // x-release-please-version
53 changes: 53 additions & 0 deletions tests/api-resources/sessions/recording/downloads.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import Browserbase from '@browserbasehq/sdk';
import { Response } from '@browserbasehq/sdk/_shims/index';

const client = new Browserbase({
apiKey: 'My API Key',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});

describe('resource downloads', () => {
test('create', async () => {
const responsePromise = client.sessions.recording.downloads.create(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
expect(response).not.toBeInstanceOf(Response);
const dataAndResponse = await responsePromise.withResponse();
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});

test('create: request options instead of 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.sessions.recording.downloads.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
path: '/_stainless_unknown_path',
}),
).rejects.toThrow(Browserbase.NotFoundError);
});

test('list', async () => {
const responsePromise = client.sessions.recording.downloads.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
expect(response).not.toBeInstanceOf(Response);
const dataAndResponse = await responsePromise.withResponse();
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});

test('list: request options instead of 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.sessions.recording.downloads.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
path: '/_stainless_unknown_path',
}),
).rejects.toThrow(Browserbase.NotFoundError);
});
});
Loading