Skip to content

Commit f5ad92d

Browse files
authored
Merge pull request #15 from browserbase/release-please--branches--main--changes--next--components--browserbase
release: 0.1.0-alpha.2
2 parents 02974f0 + 639e959 commit f5ad92d

File tree

10 files changed

+45
-34
lines changed

10 files changed

+45
-34
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.1"
2+
".": "0.1.0-alpha.2"
33
}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 18
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-60444f8b1aa1aa8dbec1e9f11e929c2b7ac27470764ef5f1796134fc27f3381c.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-9f93c744538f57747ea1385817e21b40c318b65ebc155dca8950268beb280bc9.yml

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## 0.1.0-alpha.2 (2024-10-28)
4+
5+
Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/browserbase/sdk-node/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)
6+
7+
### Features
8+
9+
* **api:** update via SDK Studio ([#16](https://github.com/browserbase/sdk-node/issues/16)) ([a96a86c](https://github.com/browserbase/sdk-node/commit/a96a86c2e7c5025cacd7edd89f88b914de3596e3))
10+
* **api:** update via SDK Studio ([#17](https://github.com/browserbase/sdk-node/issues/17)) ([52cf741](https://github.com/browserbase/sdk-node/commit/52cf741bc4c5712f2fe15ee6eaa48e4c3643ec58))
11+
312
## 0.1.0-alpha.1 (2024-10-28)
413

514
Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/browserbase/sdk-node/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)

README.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ const client = new Browserbase({
3030
});
3131

3232
async function main() {
33-
const context = await client.contexts.create({ projectId: 'projectId' });
33+
const session = await client.sessions.create({ projectId: 'your_project_id', proxies: true });
3434

35-
console.log(context.id);
35+
console.log(session.id);
3636
}
3737

3838
main();
@@ -51,8 +51,8 @@ const client = new Browserbase({
5151
});
5252

5353
async function main() {
54-
const params: Browserbase.ContextCreateParams = { projectId: 'projectId' };
55-
const context: Browserbase.ContextCreateResponse = await client.contexts.create(params);
54+
const params: Browserbase.SessionCreateParams = { projectId: 'your_project_id', proxies: true };
55+
const session: Browserbase.SessionCreateResponse = await client.sessions.create(params);
5656
}
5757

5858
main();
@@ -69,15 +69,17 @@ a subclass of `APIError` will be thrown:
6969
<!-- prettier-ignore -->
7070
```ts
7171
async function main() {
72-
const context = await client.contexts.create({ projectId: 'projectId' }).catch(async (err) => {
73-
if (err instanceof Browserbase.APIError) {
74-
console.log(err.status); // 400
75-
console.log(err.name); // BadRequestError
76-
console.log(err.headers); // {server: 'nginx', ...}
77-
} else {
78-
throw err;
79-
}
80-
});
72+
const session = await client.sessions
73+
.create({ projectId: 'your_project_id', proxies: true })
74+
.catch(async (err) => {
75+
if (err instanceof Browserbase.APIError) {
76+
console.log(err.status); // 400
77+
console.log(err.name); // BadRequestError
78+
console.log(err.headers); // {server: 'nginx', ...}
79+
} else {
80+
throw err;
81+
}
82+
});
8183
}
8284

8385
main();
@@ -112,7 +114,7 @@ const client = new Browserbase({
112114
});
113115

114116
// Or, configure per-request:
115-
await client.contexts.create({ projectId: 'projectId' }, {
117+
await client.sessions.create({ projectId: 'your_project_id', proxies: true }, {
116118
maxRetries: 5,
117119
});
118120
```
@@ -129,7 +131,7 @@ const client = new Browserbase({
129131
});
130132

131133
// Override per-request:
132-
await client.contexts.create({ projectId: 'projectId' }, {
134+
await client.sessions.create({ projectId: 'your_project_id', proxies: true }, {
133135
timeout: 5 * 1000,
134136
});
135137
```
@@ -150,15 +152,15 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi
150152
```ts
151153
const client = new Browserbase();
152154

153-
const response = await client.contexts.create({ projectId: 'projectId' }).asResponse();
155+
const response = await client.sessions.create({ projectId: 'your_project_id', proxies: true }).asResponse();
154156
console.log(response.headers.get('X-My-Header'));
155157
console.log(response.statusText); // access the underlying Response object
156158

157-
const { data: context, response: raw } = await client.contexts
158-
.create({ projectId: 'projectId' })
159+
const { data: session, response: raw } = await client.sessions
160+
.create({ projectId: 'your_project_id', proxies: true })
159161
.withResponse();
160162
console.log(raw.headers.get('X-My-Header'));
161-
console.log(context.id);
163+
console.log(session.id);
162164
```
163165

164166
### Making custom/undocumented requests
@@ -262,8 +264,8 @@ const client = new Browserbase({
262264
});
263265

264266
// Override per-request:
265-
await client.contexts.create(
266-
{ projectId: 'projectId' },
267+
await client.sessions.create(
268+
{ projectId: 'your_project_id', proxies: true },
267269
{
268270
httpAgent: new http.Agent({ keepAlive: false }),
269271
},

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ or products provided by Browserbase please follow the respective company's secur
2020

2121
### Browserbase Terms and Policies
2222

23-
Please contact dev-feedback@browserbase.com for any questions or concerns regarding security of our services.
23+
Please contact support@browserbase.com for any questions or concerns regarding security of our services.
2424

2525
---
2626

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"name": "browserbase",
3-
"version": "0.1.0-alpha.1",
3+
"version": "0.1.0-alpha.2",
44
"description": "The official TypeScript library for the Browserbase API",
5-
"author": "Browserbase <dev-feedback@browserbase.com>",
5+
"author": "Browserbase <support@browserbase.com>",
66
"types": "dist/index.d.ts",
77
"main": "dist/index.js",
88
"type": "commonjs",
99
"repository": "github:browserbase/sdk-node",
1010
"license": "Apache-2.0",
1111
"packageManager": "yarn@1.22.22",
1212
"files": [
13-
"*"
13+
"**/*"
1414
],
1515
"private": false,
1616
"scripts": {

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class Browserbase extends Core.APIClient {
8181
* API Client for interfacing with the Browserbase API.
8282
*
8383
* @param {string | undefined} [opts.apiKey=process.env['BROWSERBASE_API_KEY'] ?? undefined]
84-
* @param {string} [opts.baseURL=process.env['BROWSERBASE_BASE_URL'] ?? https://api.dev.browserbase.com] - Override the default base URL for the API.
84+
* @param {string} [opts.baseURL=process.env['BROWSERBASE_BASE_URL'] ?? https://api.browserbase.com] - Override the default base URL for the API.
8585
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
8686
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
8787
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
@@ -103,7 +103,7 @@ export class Browserbase extends Core.APIClient {
103103
const options: ClientOptions = {
104104
apiKey,
105105
...opts,
106-
baseURL: baseURL || `https://api.dev.browserbase.com`,
106+
baseURL: baseURL || `https://api.browserbase.com`,
107107
};
108108

109109
super({

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = '0.1.0-alpha.1'; // x-release-please-version
1+
export const VERSION = '0.1.0-alpha.2'; // x-release-please-version

tests/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ describe('instantiate client', () => {
151151
test('empty env variable', () => {
152152
process.env['BROWSERBASE_BASE_URL'] = ''; // empty
153153
const client = new Browserbase({ apiKey: 'My API Key' });
154-
expect(client.baseURL).toEqual('https://api.dev.browserbase.com');
154+
expect(client.baseURL).toEqual('https://api.browserbase.com');
155155
});
156156

157157
test('blank env variable', () => {
158158
process.env['BROWSERBASE_BASE_URL'] = ' '; // blank
159159
const client = new Browserbase({ apiKey: 'My API Key' });
160-
expect(client.baseURL).toEqual('https://api.dev.browserbase.com');
160+
expect(client.baseURL).toEqual('https://api.browserbase.com');
161161
});
162162
});
163163

0 commit comments

Comments
 (0)