Skip to content

Commit 99c8f40

Browse files
release: 1.5.0-alpha.0 (#153)
* chore(docs): grammar improvements * chore(docs): remove reference to rye shell * chore(docs): remove unnecessary param examples * feat(client): add follow_redirects request option * codegen metadata * chore(tests): run tests in parallel * fix(client): correctly parse binary response | stream * chore(tests): add tests for httpx client instantiation & proxies * chore(internal): update conftest.py * chore(ci): enable for pull requests * chore(readme): update badges * fix(tests): fix: tests which call HTTP endpoints directly with the example parameters * docs(client): fix httpx.Timeout documentation reference * feat(client): add support for aiohttp * chore(tests): skip some failing tests on the latest python versions * fix(ci): release-doctor — report correct token name * chore(ci): only run for pushes and fork pull requests * fix(ci): correct conditional * codegen metadata * chore(ci): change upload type * feat(api): api update * chore(internal): codegen related update * codegen metadata * feat(api): api update * chore(internal): bump pinned h11 dep * chore(package): mark python 3.13 as supported * fix(parsing): correctly handle nested discriminated unions * feat(api): api update * chore(internal): codegen related update * feat(api): api update * chore(internal): codegen related update * feat(api): api update * chore(internal): codegen related update * chore(readme): fix version rendering on pypi * feat(api): api update * fix(client): don't send Content-Type header on GET requests * feat: clean up environment call outs * feat(api): api update * feat(api): api update * fix(parsing): ignore empty metadata * fix(parsing): parse extra field types * chore(project): add settings file for vscode * feat(client): support file upload requests * chore(internal): fix ruff target version * chore: update @stainless-api/prism-cli to v5.15.0 * chore(internal): update comment in script * chore: update github action * chore(internal): change ci workflow machines * codegen metadata * fix: avoid newer type syntax * chore(internal): update pyright exclude list * chore(internal): add Sequence related utils * feat(types): replace List[str] with SequenceNotStr in params * feat: improve future compat with pydantic v3 * feat(api): manual updates * feat(api): api update * feat(api): api update * codegen metadata * fix: fix extension types in playwright_extensions * codegen metadata * feat(api): manual updates * release: 1.5.0-alpha.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Dominic Saadi <[email protected]>
1 parent 89e7f0d commit 99c8f40

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1422
-510
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ on:
77
- 'integrated/**'
88
- 'stl-preview-head/**'
99
- 'stl-preview-base/**'
10+
pull_request:
11+
branches-ignore:
12+
- 'stl-preview-head/**'
13+
- 'stl-preview-base/**'
1014

1115
jobs:
1216
lint:
1317
timeout-minutes: 10
1418
name: lint
1519
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
1621
steps:
1722
- uses: actions/checkout@v4
1823

@@ -30,24 +35,40 @@ jobs:
3035
- name: Run lints
3136
run: ./scripts/lint
3237

33-
upload:
34-
if: github.repository == 'stainless-sdks/browserbase-python'
38+
build:
39+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
3540
timeout-minutes: 10
36-
name: upload
41+
name: build
3742
permissions:
3843
contents: read
3944
id-token: write
40-
runs-on: depot-ubuntu-24.04
45+
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
4146
steps:
4247
- uses: actions/checkout@v4
4348

49+
- name: Install Rye
50+
run: |
51+
curl -sSf https://rye.astral.sh/get | bash
52+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
53+
env:
54+
RYE_VERSION: '0.44.0'
55+
RYE_INSTALL_OPTION: '--yes'
56+
57+
- name: Install dependencies
58+
run: rye sync --all-features
59+
60+
- name: Run build
61+
run: rye build
62+
4463
- name: Get GitHub OIDC Token
64+
if: github.repository == 'stainless-sdks/browserbase-python'
4565
id: github-oidc
4666
uses: actions/github-script@v6
4767
with:
4868
script: core.setOutput('github_token', await core.getIDToken());
4969

5070
- name: Upload tarball
71+
if: github.repository == 'stainless-sdks/browserbase-python'
5172
env:
5273
URL: https://pkg.stainless.com/s
5374
AUTH: ${{ steps.github-oidc.outputs.github_token }}
@@ -58,6 +79,7 @@ jobs:
5879
timeout-minutes: 10
5980
name: test
6081
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
82+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
6183
steps:
6284
- uses: actions/checkout@v4
6385

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.prism.log
2-
.vscode
32
_dev
43

54
__pycache__

.release-please-manifest.json

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

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 18
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-e2ed1b5267eeff92982918505349017b9155da2c7ab948787ab11cf9068af1b8.yml
3-
openapi_spec_hash: 6639c21dccb52ca610cae833227a9791
4-
config_hash: 74882e23a455dece33e43a27e67f0fbb
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-a9ab6f9017f7645722d220eb8172516a7a5400e86542c28fc7e121adcd1f344f.yml
3+
openapi_spec_hash: e29347aba2697d4efa3dce7794810dbd
4+
config_hash: ec077c0d8cde29588ca4ff30d49575a4

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.analysis.importFormat": "relative",
3+
}

CHANGELOG.md

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

3+
## 1.5.0-alpha.0 (2025-09-05)
4+
5+
Full Changelog: [v1.4.0...v1.5.0-alpha.0](https://github.com/browserbase/sdk-python/compare/v1.4.0...v1.5.0-alpha.0)
6+
7+
### Features
8+
9+
* **api:** api update ([e94ddbd](https://github.com/browserbase/sdk-python/commit/e94ddbd8777b97d4e8ab193e1bf3eaad983ecec9))
10+
* **api:** api update ([28115fb](https://github.com/browserbase/sdk-python/commit/28115fb584336dbf5b08043ad8f9cf1d911240ea))
11+
* **api:** api update ([3209287](https://github.com/browserbase/sdk-python/commit/32092872a3d4d48824b4d77d517ffdb06470ad95))
12+
* **api:** api update ([f38e029](https://github.com/browserbase/sdk-python/commit/f38e02981ae0777cb3d922845902b2673dc832fa))
13+
* **api:** api update ([1d9f769](https://github.com/browserbase/sdk-python/commit/1d9f7694bc0d465ce758ddcec41359e9cd1a08ad))
14+
* **api:** api update ([d72f39f](https://github.com/browserbase/sdk-python/commit/d72f39fbe29342cfc77e9b224f2ad0a5a77aaae4))
15+
* **api:** api update ([6d449b3](https://github.com/browserbase/sdk-python/commit/6d449b3deb284a72528877a8729f4cf7a418275d))
16+
* **api:** api update ([8bd5f8b](https://github.com/browserbase/sdk-python/commit/8bd5f8bcca3a2e5baadfc06009546692e63eb744))
17+
* **api:** api update ([1ce99ef](https://github.com/browserbase/sdk-python/commit/1ce99efe89c1d0757ca3100cca8619faa4082f74))
18+
* **api:** api update ([1cbb849](https://github.com/browserbase/sdk-python/commit/1cbb8498bf70c15c001f620b821519216cbadd97))
19+
* **api:** manual updates ([5893fc6](https://github.com/browserbase/sdk-python/commit/5893fc6165cfd88378d6725317e30c7cb6faf8df))
20+
* **api:** manual updates ([074f06d](https://github.com/browserbase/sdk-python/commit/074f06d0dfb08554229348828afd2cc1defe94ee))
21+
* clean up environment call outs ([82c38c4](https://github.com/browserbase/sdk-python/commit/82c38c494a175c1b6b38bab3615916c30ba25d14))
22+
* **client:** add follow_redirects request option ([a8b0b5e](https://github.com/browserbase/sdk-python/commit/a8b0b5e4c6445e0e8c0d3673a090aabab09a50fd))
23+
* **client:** add support for aiohttp ([3516092](https://github.com/browserbase/sdk-python/commit/35160921e262f147cc723a754f14cfd9875603f5))
24+
* **client:** support file upload requests ([2f338f0](https://github.com/browserbase/sdk-python/commit/2f338f009e556ef9be05f49816b17cef138bda17))
25+
* improve future compat with pydantic v3 ([8b5256c](https://github.com/browserbase/sdk-python/commit/8b5256c801e1423a4daf6bf49de7509a32ebfde2))
26+
* **types:** replace List[str] with SequenceNotStr in params ([55083f6](https://github.com/browserbase/sdk-python/commit/55083f678b68020fae835af5cd58e0e5deea2888))
27+
28+
29+
### Bug Fixes
30+
31+
* avoid newer type syntax ([85f597b](https://github.com/browserbase/sdk-python/commit/85f597b34d149138f1b5afdc52062cb131e3a30a))
32+
* **ci:** correct conditional ([a36b873](https://github.com/browserbase/sdk-python/commit/a36b87379b404613673720dd9f498ed76dfe5c3a))
33+
* **ci:** release-doctor — report correct token name ([61b97ff](https://github.com/browserbase/sdk-python/commit/61b97fff5ea92bade293c5f5f4a84b0d991375e7))
34+
* **client:** correctly parse binary response | stream ([9614c4c](https://github.com/browserbase/sdk-python/commit/9614c4c05bc57ea60100aec9a194aee7a39e701b))
35+
* **client:** don't send Content-Type header on GET requests ([c4c4185](https://github.com/browserbase/sdk-python/commit/c4c4185de32b28c09565b6fe84efd65fd411abb9))
36+
* fix extension types in playwright_extensions ([8b652e7](https://github.com/browserbase/sdk-python/commit/8b652e78be1493d03e13d2a116cbc6969a880e58))
37+
* **parsing:** correctly handle nested discriminated unions ([d020678](https://github.com/browserbase/sdk-python/commit/d0206786894ecfb22e0924edb8a227414b17788d))
38+
* **parsing:** ignore empty metadata ([118c4d4](https://github.com/browserbase/sdk-python/commit/118c4d41bda811d2d942793d8ab029b272c7a5c6))
39+
* **parsing:** parse extra field types ([c7ef875](https://github.com/browserbase/sdk-python/commit/c7ef87549e324fb06fab945e1754ef7b56b30031))
40+
* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([e298407](https://github.com/browserbase/sdk-python/commit/e2984077537fd6dee0191329a083ad0ccf9fd76f))
41+
42+
43+
### Chores
44+
45+
* **ci:** change upload type ([e42da7c](https://github.com/browserbase/sdk-python/commit/e42da7c1fed216ff2b15223c49f1111bc0ef16e5))
46+
* **ci:** enable for pull requests ([03a6db7](https://github.com/browserbase/sdk-python/commit/03a6db72e98bf1606bf68928b2ac5029cba088df))
47+
* **ci:** only run for pushes and fork pull requests ([c8cb51f](https://github.com/browserbase/sdk-python/commit/c8cb51f311f4d39863127fab189c95d84a186bc6))
48+
* **docs:** grammar improvements ([f32a9e2](https://github.com/browserbase/sdk-python/commit/f32a9e258a9b0b4d29c24137d5a7207907f00f9b))
49+
* **docs:** remove reference to rye shell ([07d129a](https://github.com/browserbase/sdk-python/commit/07d129a04211037d123b06d36347741960e75323))
50+
* **docs:** remove unnecessary param examples ([62209dc](https://github.com/browserbase/sdk-python/commit/62209dcac034f40ac8b3b8a119e532201a227680))
51+
* **internal:** add Sequence related utils ([34b0dd6](https://github.com/browserbase/sdk-python/commit/34b0dd6b4297fafc2bcb9e8243c8d3c2e2e435fc))
52+
* **internal:** bump pinned h11 dep ([5e3270d](https://github.com/browserbase/sdk-python/commit/5e3270da2e4f41efdd345d073a42d6791eb22a84))
53+
* **internal:** change ci workflow machines ([14c0ac4](https://github.com/browserbase/sdk-python/commit/14c0ac49a6d9d42f5401a5c24ddb8586b3998fb2))
54+
* **internal:** codegen related update ([f979aff](https://github.com/browserbase/sdk-python/commit/f979aff605c0d74efb561e0b169ad39b486ab5a0))
55+
* **internal:** codegen related update ([12de9f3](https://github.com/browserbase/sdk-python/commit/12de9f324fbb40bec91cd7c6b16af1440c4f7373))
56+
* **internal:** codegen related update ([c4157cb](https://github.com/browserbase/sdk-python/commit/c4157cb8470b1d0ca67e6757f4fe9146a630cc82))
57+
* **internal:** codegen related update ([ccb2c95](https://github.com/browserbase/sdk-python/commit/ccb2c95002bb6a38e1eb8b9a84e4a335d5ee1a13))
58+
* **internal:** fix ruff target version ([e6a3df4](https://github.com/browserbase/sdk-python/commit/e6a3df40564b4ba3d23514e0b42221010d465bf6))
59+
* **internal:** update comment in script ([a7aec17](https://github.com/browserbase/sdk-python/commit/a7aec17c02632684dfeb7759dd6a5322efe092ce))
60+
* **internal:** update conftest.py ([5d3a2b1](https://github.com/browserbase/sdk-python/commit/5d3a2b1906ca5fca5c84c6d6684a8a62b6700479))
61+
* **internal:** update pyright exclude list ([33ba4b4](https://github.com/browserbase/sdk-python/commit/33ba4b47ddeb8c0aa19a11f35a7cea9aa9a0966d))
62+
* **package:** mark python 3.13 as supported ([2450b8e](https://github.com/browserbase/sdk-python/commit/2450b8eb2349adde689febd09269915d41e7a590))
63+
* **project:** add settings file for vscode ([a406241](https://github.com/browserbase/sdk-python/commit/a4062413b2fce397d59ea9ceaec7ed0565880fe2))
64+
* **readme:** fix version rendering on pypi ([a8afe1a](https://github.com/browserbase/sdk-python/commit/a8afe1a67c48080ef202cac88da9b5d59534799a))
65+
* **readme:** update badges ([869a3f4](https://github.com/browserbase/sdk-python/commit/869a3f4dd7e6f19225b697aeee89ce98a2174c0a))
66+
* **tests:** add tests for httpx client instantiation & proxies ([9c5d88c](https://github.com/browserbase/sdk-python/commit/9c5d88cb4cbbda5aa618cba2f5217bacd4a228cc))
67+
* **tests:** run tests in parallel ([94308de](https://github.com/browserbase/sdk-python/commit/94308dea065f54268145b175a13e0dbfd2a9cc81))
68+
* **tests:** skip some failing tests on the latest python versions ([7bc40f0](https://github.com/browserbase/sdk-python/commit/7bc40f068d290a479a0d4070ef54e8f8c4ef598d))
69+
* update @stainless-api/prism-cli to v5.15.0 ([b48933b](https://github.com/browserbase/sdk-python/commit/b48933b2f68eafaa554662eb7f41bf960a74d8b6))
70+
* update github action ([d57dc03](https://github.com/browserbase/sdk-python/commit/d57dc0398b083556ed7ceee265efcf282062005d))
71+
72+
73+
### Documentation
74+
75+
* **client:** fix httpx.Timeout documentation reference ([4bbda56](https://github.com/browserbase/sdk-python/commit/4bbda56cdb4adf677f67011f42f5c3e324a5f60e))
76+
377
## 1.4.0 (2025-05-16)
478

579
Full Changelog: [v1.3.0...v1.4.0](https://github.com/browserbase/sdk-python/compare/v1.3.0...v1.4.0)

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ $ rye sync --all-features
1717
You can then run scripts using `rye run python script.py` or by activating the virtual environment:
1818

1919
```sh
20-
$ rye shell
21-
# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
20+
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
2221
$ source .venv/bin/activate
2322

2423
# now you can omit the `rye run` prefix

README.md

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Browserbase Python API library
22

3-
[![PyPI version](https://img.shields.io/pypi/v/browserbase.svg)](https://pypi.org/project/browserbase/)
3+
<!-- prettier-ignore -->
4+
[![PyPI version](https://img.shields.io/pypi/v/browserbase.svg?label=pypi%20(stable))](https://pypi.org/project/browserbase/)
45

56
The Browserbase Python library provides convenient access to the Browserbase REST API from any Python 3.8+
67
application. The library includes type definitions for all request params and response fields,
@@ -16,7 +17,7 @@ The REST API documentation can be found on [docs.browserbase.com](https://docs.b
1617

1718
```sh
1819
# install from PyPI
19-
pip install browserbase
20+
pip install --pre browserbase
2021
```
2122

2223
## Usage
@@ -81,6 +82,39 @@ rye run example playwright_basic # replace with the example you want to run
8182
> [!NOTE]
8283
> Make sure you have a `.env` file that matches the [.env.example](.env.example) file in the root of this repository.
8384
85+
### With aiohttp
86+
87+
By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.
88+
89+
You can enable this by installing `aiohttp`:
90+
91+
```sh
92+
# install from PyPI
93+
pip install --pre browserbase[aiohttp]
94+
```
95+
96+
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
97+
98+
```python
99+
import asyncio
100+
from browserbase import DefaultAioHttpClient
101+
from browserbase import AsyncBrowserbase
102+
103+
104+
async def main() -> None:
105+
async with AsyncBrowserbase(
106+
api_key="My API Key",
107+
http_client=DefaultAioHttpClient(),
108+
) as client:
109+
session = await client.sessions.create(
110+
project_id="your_project_id",
111+
)
112+
print(session.id)
113+
114+
115+
asyncio.run(main())
116+
```
117+
84118
## Using types
85119

86120
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
@@ -101,37 +135,7 @@ client = Browserbase()
101135

102136
session = client.sessions.create(
103137
project_id="projectId",
104-
browser_settings={
105-
"advanced_stealth": True,
106-
"block_ads": True,
107-
"captcha_image_selector": "captchaImageSelector",
108-
"captcha_input_selector": "captchaInputSelector",
109-
"context": {
110-
"id": "id",
111-
"persist": True,
112-
},
113-
"extension_id": "extensionId",
114-
"fingerprint": {
115-
"browsers": ["chrome"],
116-
"devices": ["desktop"],
117-
"http_version": "1",
118-
"locales": ["string"],
119-
"operating_systems": ["android"],
120-
"screen": {
121-
"max_height": 0,
122-
"max_width": 0,
123-
"min_height": 0,
124-
"min_width": 0,
125-
},
126-
},
127-
"log_session": True,
128-
"record_session": True,
129-
"solve_captchas": True,
130-
"viewport": {
131-
"height": 0,
132-
"width": 0,
133-
},
134-
},
138+
browser_settings={},
135139
)
136140
print(session.browser_settings)
137141
```
@@ -222,7 +226,7 @@ client.with_options(max_retries=5).sessions.create(
222226
### Timeouts
223227

224228
By default requests time out after 1 minute. You can configure this with a `timeout` option,
225-
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
229+
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
226230

227231
```python
228232
from browserbase import Browserbase

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ before making any information public.
1616
## Reporting Non-SDK Related Security Issues
1717

1818
If you encounter security issues that are not directly related to SDKs but pertain to the services
19-
or products provided by Browserbase please follow the respective company's security reporting guidelines.
19+
or products provided by Browserbase, please follow the respective company's security reporting guidelines.
2020

2121
### Browserbase Terms and Policies
2222

23-
Please contact [email protected] for any questions or concerns regarding security of our services.
23+
Please contact [email protected] for any questions or concerns regarding the security of our services.
2424

2525
---
2626

0 commit comments

Comments
 (0)