Skip to content

Commit 7615211

Browse files
Stainless Botstainless-bot
Stainless Bot
authored andcommitted
feat: various codegen changes
1 parent 2ecb572 commit 7615211

File tree

2 files changed

+16
-219
lines changed

2 files changed

+16
-219
lines changed

LICENSE

Lines changed: 0 additions & 201 deletions
This file was deleted.

README.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const client = new Browserbase({
2727
});
2828

2929
async function main() {
30-
const session = await client.sessions.create({ projectId: 'your_project_id', proxies: true });
30+
const session = await client.sessions.create({ projectId: 'your_project_id' });
3131

3232
console.log(session.id);
3333
}
@@ -48,7 +48,7 @@ const client = new Browserbase({
4848
});
4949

5050
async function main() {
51-
const params: Browserbase.SessionCreateParams = { projectId: 'your_project_id', proxies: true };
51+
const params: Browserbase.SessionCreateParams = { projectId: 'your_project_id' };
5252
const session: Browserbase.SessionCreateResponse = await client.sessions.create(params);
5353
}
5454

@@ -66,17 +66,15 @@ a subclass of `APIError` will be thrown:
6666
<!-- prettier-ignore -->
6767
```ts
6868
async function main() {
69-
const session = await client.sessions
70-
.create({ projectId: 'your_project_id', proxies: true })
71-
.catch(async (err) => {
72-
if (err instanceof Browserbase.APIError) {
73-
console.log(err.status); // 400
74-
console.log(err.name); // BadRequestError
75-
console.log(err.headers); // {server: 'nginx', ...}
76-
} else {
77-
throw err;
78-
}
79-
});
69+
const session = await client.sessions.create({ projectId: 'your_project_id' }).catch(async (err) => {
70+
if (err instanceof Browserbase.APIError) {
71+
console.log(err.status); // 400
72+
console.log(err.name); // BadRequestError
73+
console.log(err.headers); // {server: 'nginx', ...}
74+
} else {
75+
throw err;
76+
}
77+
});
8078
}
8179

8280
main();
@@ -111,7 +109,7 @@ const client = new Browserbase({
111109
});
112110

113111
// Or, configure per-request:
114-
await client.sessions.create({ projectId: 'your_project_id', proxies: true }, {
112+
await client.sessions.create({ projectId: 'your_project_id' }, {
115113
maxRetries: 5,
116114
});
117115
```
@@ -128,7 +126,7 @@ const client = new Browserbase({
128126
});
129127

130128
// Override per-request:
131-
await client.sessions.create({ projectId: 'your_project_id', proxies: true }, {
129+
await client.sessions.create({ projectId: 'your_project_id' }, {
132130
timeout: 5 * 1000,
133131
});
134132
```
@@ -149,12 +147,12 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi
149147
```ts
150148
const client = new Browserbase();
151149

152-
const response = await client.sessions.create({ projectId: 'your_project_id', proxies: true }).asResponse();
150+
const response = await client.sessions.create({ projectId: 'your_project_id' }).asResponse();
153151
console.log(response.headers.get('X-My-Header'));
154152
console.log(response.statusText); // access the underlying Response object
155153

156154
const { data: session, response: raw } = await client.sessions
157-
.create({ projectId: 'your_project_id', proxies: true })
155+
.create({ projectId: 'your_project_id' })
158156
.withResponse();
159157
console.log(raw.headers.get('X-My-Header'));
160158
console.log(session.id);
@@ -262,7 +260,7 @@ const client = new Browserbase({
262260

263261
// Override per-request:
264262
await client.sessions.create(
265-
{ projectId: 'your_project_id', proxies: true },
263+
{ projectId: 'your_project_id' },
266264
{
267265
httpAgent: new http.Agent({ keepAlive: false }),
268266
},

0 commit comments

Comments
 (0)