🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@browserbasehq/sdk

Package Overview
Dependencies
Maintainers
0
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@browserbasehq/sdk - npm Package Compare versions

Comparing version

to
2.4.0

resources/sessions.d.ts

29

CHANGELOG.md
# Changelog
## 2.4.0 (2025-03-14)
Full Changelog: [v2.3.0...v2.4.0](https://github.com/browserbase/sdk-node/compare/v2.3.0...v2.4.0)
### Features
* **api:** api update ([#142](https://github.com/browserbase/sdk-node/issues/142)) ([b2391f8](https://github.com/browserbase/sdk-node/commit/b2391f8eb6b6a35d033de3b54a8731a59601c177))
* **api:** api update ([#144](https://github.com/browserbase/sdk-node/issues/144)) ([c7aaea1](https://github.com/browserbase/sdk-node/commit/c7aaea13fae457c258a8ee97b7b1717866f15b2d))
### Bug Fixes
* **client:** fix export map for index exports ([#137](https://github.com/browserbase/sdk-node/issues/137)) ([7e3ba08](https://github.com/browserbase/sdk-node/commit/7e3ba0874d40256119ab5f9f556bff5a43425188))
* **exports:** ensure resource imports don't require /index ([#146](https://github.com/browserbase/sdk-node/issues/146)) ([c6ec9a5](https://github.com/browserbase/sdk-node/commit/c6ec9a5a8a87c6e1d811945c89bc674188198bf7))
### Chores
* **internal:** codegen related update ([#138](https://github.com/browserbase/sdk-node/issues/138)) ([316a6af](https://github.com/browserbase/sdk-node/commit/316a6af67a7c7daa6d78956e7dab1fd88f4bf90c))
* **internal:** codegen related update ([#143](https://github.com/browserbase/sdk-node/issues/143)) ([d8d3fb9](https://github.com/browserbase/sdk-node/commit/d8d3fb9f1d3ee6497cd781fee475e475416237cf))
* **internal:** fix devcontainers setup ([#139](https://github.com/browserbase/sdk-node/issues/139)) ([40202bd](https://github.com/browserbase/sdk-node/commit/40202bdf590f7df08d872c70a362ac7c3c1393a2))
* **internal:** version bump ([#129](https://github.com/browserbase/sdk-node/issues/129)) ([82c57f9](https://github.com/browserbase/sdk-node/commit/82c57f9b9c51dd5e29c4ccdb1855a8883b28ab08))
* **internal:** version bump ([#135](https://github.com/browserbase/sdk-node/issues/135)) ([90a4906](https://github.com/browserbase/sdk-node/commit/90a4906a5fbddf73b49cd45293619a9deadcb3e0))
### Documentation
* update URLs from stainlessapi.com to stainless.com ([#140](https://github.com/browserbase/sdk-node/issues/140)) ([0e240d7](https://github.com/browserbase/sdk-node/commit/0e240d7076fba9e8220d0fadb177426fe7bf3972))
## 2.3.0 (2025-02-05)

@@ -4,0 +33,0 @@

3

core.js

@@ -38,3 +38,4 @@ "use strict";

const contentType = response.headers.get('content-type');
const isJSON = contentType?.includes('application/json') || contentType?.includes('application/vnd.api+json');
const mediaType = contentType?.split(';')[0]?.trim();
const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
if (isJSON) {

@@ -41,0 +42,0 @@ const json = await response.json();

@@ -9,3 +9,3 @@ import { type Agent } from "./_shims/index.js";

import { Project, ProjectListResponse, ProjectUsage, Projects } from "./resources/projects.js";
import { Session, SessionCreateParams, SessionCreateResponse, SessionListParams, SessionListResponse, SessionLiveURLs, SessionUpdateParams, Sessions } from "./resources/sessions/sessions.js";
import { Session, SessionCreateParams, SessionCreateResponse, SessionListParams, SessionListResponse, SessionLiveURLs, SessionRetrieveResponse, SessionUpdateParams, Sessions } from "./resources/sessions/sessions.js";
export interface ClientOptions {

@@ -115,3 +115,3 @@ /**

export { Projects as Projects, type Project as Project, type ProjectUsage as ProjectUsage, type ProjectListResponse as ProjectListResponse, };
export { Sessions as Sessions, type Session as Session, type SessionLiveURLs as SessionLiveURLs, type SessionCreateResponse as SessionCreateResponse, type SessionListResponse as SessionListResponse, type SessionCreateParams as SessionCreateParams, type SessionUpdateParams as SessionUpdateParams, type SessionListParams as SessionListParams, };
export { Sessions as Sessions, type Session as Session, type SessionLiveURLs as SessionLiveURLs, type SessionCreateResponse as SessionCreateResponse, type SessionRetrieveResponse as SessionRetrieveResponse, type SessionListResponse as SessionListResponse, type SessionCreateParams as SessionCreateParams, type SessionUpdateParams as SessionUpdateParams, type SessionListParams as SessionListParams, };
}

@@ -118,0 +118,0 @@ export { toFile, fileFromPath } from "./uploads.js";

{
"name": "@browserbasehq/sdk",
"version": "2.3.0",
"version": "2.4.0",
"description": "The official Node.js library for the Browserbase API",

@@ -89,15 +89,36 @@ "author": "Browserbase <support@browserbase.com>",

"./*.mjs": {
"types": "./*.d.ts",
"default": "./*.mjs"
"types": [
"./*.d.ts",
"./*/index.d.ts"
],
"default": [
"./*.mjs",
"./*/index.mjs"
]
},
"./*.js": {
"types": "./*.d.ts",
"default": "./*.js"
"types": [
"./*.d.ts",
"./*/index.d.ts"
],
"default": [
"./*.js",
"./*/index.js"
]
},
"./*": {
"types": "./*.d.ts",
"require": "./*.js",
"default": "./*.mjs"
"types": [
"./*.d.ts",
"./*/index.d.ts"
],
"require": [
"./*.js",
"./*/index.js"
],
"default": [
"./*.mjs",
"./*/index.mjs"
]
}
}
}

@@ -9,3 +9,3 @@ # Browserbase Node API Library

It is generated with [Stainless](https://www.stainlessapi.com/).
It is generated with [Stainless](https://www.stainless.com/).

@@ -61,2 +61,32 @@ ## Installation

## File uploads
Request parameters that correspond to file uploads can be passed in many different forms:
- `File` (or an object with the same structure)
- a `fetch` `Response` (or an object with the same structure)
- an `fs.ReadStream`
- the return value of our `toFile` helper
```ts
import fs from 'fs';
import fetch from 'node-fetch';
import Browserbase, { toFile } from '@browserbasehq/sdk';
const client = new Browserbase();
// If you have access to Node `fs` we recommend using `fs.createReadStream()`:
await client.extensions.create({ file: fs.createReadStream('/path/to/file') });
// Or if you have the web `File` API you can pass a `File` instance:
await client.extensions.create({ file: new File(['my bytes'], 'file') });
// You can also pass a `fetch` `Response`:
await client.extensions.create({ file: await fetch('https://somesite/file') });
// Finally, if none of the above are convenient, you can use our `toFile` helper:
await client.extensions.create({ file: await toFile(Buffer.from('my bytes'), 'file') });
await client.extensions.create({ file: await toFile(new Uint8Array([0, 1, 2]), 'file') });
```
## Handling errors

@@ -63,0 +93,0 @@

export { Contexts, type Context, type ContextCreateResponse, type ContextUpdateResponse, type ContextCreateParams, } from "./contexts.js";
export { Extensions, type Extension, type ExtensionCreateParams } from "./extensions.js";
export { Projects, type Project, type ProjectUsage, type ProjectListResponse } from "./projects.js";
export { Sessions, type Session, type SessionLiveURLs, type SessionCreateResponse, type SessionListResponse, type SessionCreateParams, type SessionUpdateParams, type SessionListParams, } from "./sessions/sessions.js";
export { Sessions, type Session, type SessionLiveURLs, type SessionCreateResponse, type SessionRetrieveResponse, type SessionListResponse, type SessionCreateParams, type SessionUpdateParams, type SessionListParams, } from "./sessions/sessions.js";
//# sourceMappingURL=index.d.ts.map
export { Downloads } from "./downloads.js";
export { Logs, type SessionLog, type LogListResponse } from "./logs.js";
export { Recording, type SessionRecording, type RecordingRetrieveResponse } from "./recording.js";
export { Sessions, type Session, type SessionLiveURLs, type SessionCreateResponse, type SessionListResponse, type SessionCreateParams, type SessionUpdateParams, type SessionListParams, } from "./sessions.js";
export { Sessions, type Session, type SessionLiveURLs, type SessionCreateResponse, type SessionRetrieveResponse, type SessionListResponse, type SessionCreateParams, type SessionUpdateParams, type SessionListParams, } from "./sessions.js";
export { Uploads, type UploadCreateResponse, type UploadCreateParams } from "./uploads.js";
//# sourceMappingURL=index.d.ts.map

@@ -23,3 +23,3 @@ import { APIResource } from "../../resource.js";

*/
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Session>;
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<SessionRetrieveResponse>;
/**

@@ -151,2 +151,56 @@ * Update Session

}
export interface SessionRetrieveResponse {
id: string;
createdAt: string;
expiresAt: string;
/**
* Indicates if the Session was created to be kept alive upon disconnections
*/
keepAlive: boolean;
/**
* The Project ID linked to the Session.
*/
projectId: string;
/**
* Bytes used via the [Proxy](/features/stealth-mode#proxies-and-residential-ips)
*/
proxyBytes: number;
/**
* The region where the Session is running.
*/
region: 'us-west-2' | 'us-east-1' | 'eu-central-1' | 'ap-southeast-1';
startedAt: string;
status: 'RUNNING' | 'ERROR' | 'TIMED_OUT' | 'COMPLETED';
updatedAt: string;
/**
* CPU used by the Session
*/
avgCpuUsage?: number;
/**
* WebSocket URL to connect to the Session.
*/
connectUrl?: string;
/**
* Optional. The Context linked to the Session.
*/
contextId?: string;
endedAt?: string;
/**
* Memory used by the Session
*/
memoryUsage?: number;
/**
* HTTP URL to connect to the Session.
*/
seleniumRemoteUrl?: string;
/**
* Signing key to use when connecting to the Session via HTTP.
*/
signingKey?: string;
/**
* Arbitrary user metadata to attach to the session. To learn more about user
* metadata, see [User Metadata](/features/sessions#user-metadata).
*/
userMetadata?: Record<string, unknown>;
}
export type SessionListResponse = Array<Session>;

@@ -243,3 +297,3 @@ export interface SessionCreateParams {

devices?: Array<'desktop' | 'mobile'>;
httpVersion?: 1 | 2;
httpVersion?: '1' | '2';
/**

@@ -351,3 +405,3 @@ * Full list of locales is available

export declare namespace Sessions {
export { type Session as Session, type SessionLiveURLs as SessionLiveURLs, type SessionCreateResponse as SessionCreateResponse, type SessionListResponse as SessionListResponse, type SessionCreateParams as SessionCreateParams, type SessionUpdateParams as SessionUpdateParams, type SessionListParams as SessionListParams, };
export { type Session as Session, type SessionLiveURLs as SessionLiveURLs, type SessionCreateResponse as SessionCreateResponse, type SessionRetrieveResponse as SessionRetrieveResponse, type SessionListResponse as SessionListResponse, type SessionCreateParams as SessionCreateParams, type SessionUpdateParams as SessionUpdateParams, type SessionListParams as SessionListParams, };
export { Downloads as Downloads };

@@ -354,0 +408,0 @@ export { Logs as Logs, type SessionLog as SessionLog, type LogListResponse as LogListResponse };

@@ -51,4 +51,4 @@ import { VERSION } from './version';

const contentType = response.headers.get('content-type');
const isJSON =
contentType?.includes('application/json') || contentType?.includes('application/vnd.api+json');
const mediaType = contentType?.split(';')[0]?.trim();
const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
if (isJSON) {

@@ -55,0 +55,0 @@ const json = await response.json();

@@ -24,2 +24,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

SessionLiveURLs,
SessionRetrieveResponse,
SessionUpdateParams,

@@ -216,2 +217,3 @@ Sessions,

type SessionCreateResponse as SessionCreateResponse,
type SessionRetrieveResponse as SessionRetrieveResponse,
type SessionListResponse as SessionListResponse,

@@ -218,0 +220,0 @@ type SessionCreateParams as SessionCreateParams,

@@ -17,2 +17,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

type SessionCreateResponse,
type SessionRetrieveResponse,
type SessionListResponse,

@@ -19,0 +20,0 @@ type SessionCreateParams,

@@ -11,2 +11,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

type SessionCreateResponse,
type SessionRetrieveResponse,
type SessionListResponse,

@@ -13,0 +14,0 @@ type SessionCreateParams,

@@ -31,3 +31,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

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

@@ -221,2 +221,74 @@ }

export interface SessionRetrieveResponse {
id: string;
createdAt: string;
expiresAt: string;
/**
* Indicates if the Session was created to be kept alive upon disconnections
*/
keepAlive: boolean;
/**
* The Project ID linked to the Session.
*/
projectId: string;
/**
* Bytes used via the [Proxy](/features/stealth-mode#proxies-and-residential-ips)
*/
proxyBytes: number;
/**
* The region where the Session is running.
*/
region: 'us-west-2' | 'us-east-1' | 'eu-central-1' | 'ap-southeast-1';
startedAt: string;
status: 'RUNNING' | 'ERROR' | 'TIMED_OUT' | 'COMPLETED';
updatedAt: string;
/**
* CPU used by the Session
*/
avgCpuUsage?: number;
/**
* WebSocket URL to connect to the Session.
*/
connectUrl?: string;
/**
* Optional. The Context linked to the Session.
*/
contextId?: string;
endedAt?: string;
/**
* Memory used by the Session
*/
memoryUsage?: number;
/**
* HTTP URL to connect to the Session.
*/
seleniumRemoteUrl?: string;
/**
* Signing key to use when connecting to the Session via HTTP.
*/
signingKey?: string;
/**
* Arbitrary user metadata to attach to the session. To learn more about user
* metadata, see [User Metadata](/features/sessions#user-metadata).
*/
userMetadata?: Record<string, unknown>;
}
export type SessionListResponse = Array<Session>;

@@ -337,3 +409,3 @@

httpVersion?: 1 | 2;
httpVersion?: '1' | '2';

@@ -479,2 +551,3 @@ /**

type SessionCreateResponse as SessionCreateResponse,
type SessionRetrieveResponse as SessionRetrieveResponse,
type SessionListResponse as SessionListResponse,

@@ -481,0 +554,0 @@ type SessionCreateParams as SessionCreateParams,

@@ -1,1 +0,1 @@

export const VERSION = '2.3.0'; // x-release-please-version
export const VERSION = '2.4.0'; // x-release-please-version

@@ -1,2 +0,2 @@

export declare const VERSION = "2.3.0";
export declare const VERSION = "2.4.0";
//# sourceMappingURL=version.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0;
exports.VERSION = '2.3.0'; // x-release-please-version
exports.VERSION = '2.4.0'; // x-release-please-version
//# sourceMappingURL=version.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet