Skip to content

Commit 0a3c371

Browse files
release: 1.1.0 (#79)
* chore: make the `Omit` type public (#78) * chore(internal): bump pydantic dependency (#81) * docs(readme): fix http client proxies example (#82) * chore(internal): bump pyright (#83) * chore(internal): add support for TypeAliasType (#85) * chore(internal): codegen related update (#86) * chore(internal): codegen related update (#87) * chore(internal): codegen related update (#88) * chore(internal): remove some duplicated imports (#89) * chore(internal): updated imports (#90) * docs(readme): example snippet for client context manager (#91) * chore(internal): fix some typos (#92) * chore(internal): codegen related update (#93) * chore: add missing isclass check (#94) * chore(internal): bump httpx dependency (#95) * fix(client): only call .close() when needed (#97) * docs: fix typos (#98) * chore(internal): codegen related update (#99) * fix: correctly handle deserialising `cls` fields (#100) * feat(api): api update (#101) * chore(internal): codegen related update (#102) * feat(api): api update (#104) * feat(api): api update (#105) * chore(internal): codegen related update (#106) * chore(internal): codegen related update (#107) * feat(api): api update (#109) * chore(internal): minor formatting changes (#110) * feat(api): api update (#111) * release: 1.1.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 9b26700 commit 0a3c371

Some content is hidden

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

46 files changed

+367
-180
lines changed

Diff for: .github/workflows/ci.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
lint:
1313
name: lint
1414
runs-on: ubuntu-latest
15-
1615

1716
steps:
1817
- uses: actions/checkout@v4
@@ -30,6 +29,7 @@ jobs:
3029

3130
- name: Run lints
3231
run: ./scripts/lint
32+
3333
test:
3434
name: test
3535
runs-on: ubuntu-latest
@@ -50,4 +50,3 @@ jobs:
5050

5151
- name: Run tests
5252
run: ./scripts/test
53-

Diff for: .release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.0.5"
2+
".": "1.1.0"
33
}

Diff for: .stats.yml

+1-1
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-7f88912695bab2b98cb73137e6f36125d02fdfaf8eed4532ee1c82385609a259.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-396a2b9092f645c5a9e46a1f3be8c2e45ca9ae079e1d39761eb0a73f56e24b15.yml

Diff for: CHANGELOG.md

+47
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,52 @@
11
# Changelog
22

3+
## 1.1.0 (2025-01-28)
4+
5+
Full Changelog: [v1.0.5...v1.1.0](https://github.com/browserbase/sdk-python/compare/v1.0.5...v1.1.0)
6+
7+
### Features
8+
9+
* **api:** api update ([#101](https://github.com/browserbase/sdk-python/issues/101)) ([5be14e9](https://github.com/browserbase/sdk-python/commit/5be14e9b49b95daa2bc043ed8c33b2d4527a7361))
10+
* **api:** api update ([#104](https://github.com/browserbase/sdk-python/issues/104)) ([c13b2f9](https://github.com/browserbase/sdk-python/commit/c13b2f95924c940deece1f6e3b1e4ca2dfbd9fe7))
11+
* **api:** api update ([#105](https://github.com/browserbase/sdk-python/issues/105)) ([fc3b82f](https://github.com/browserbase/sdk-python/commit/fc3b82f224e92e273d484f8b0f52eb433210e38b))
12+
* **api:** api update ([#109](https://github.com/browserbase/sdk-python/issues/109)) ([faca7e9](https://github.com/browserbase/sdk-python/commit/faca7e94c6086d461b81f2806868af2e1506e035))
13+
* **api:** api update ([#111](https://github.com/browserbase/sdk-python/issues/111)) ([42ae774](https://github.com/browserbase/sdk-python/commit/42ae77474c2fbe9eefd9929e15d8d51cbf40bc00))
14+
15+
16+
### Bug Fixes
17+
18+
* **client:** only call .close() when needed ([#97](https://github.com/browserbase/sdk-python/issues/97)) ([01d5bd5](https://github.com/browserbase/sdk-python/commit/01d5bd5eb7675fc069fe01e7651d769df182270a))
19+
* correctly handle deserialising `cls` fields ([#100](https://github.com/browserbase/sdk-python/issues/100)) ([b617b85](https://github.com/browserbase/sdk-python/commit/b617b85ef3cce3c16e38125bec483c72bc3d43c0))
20+
21+
22+
### Chores
23+
24+
* add missing isclass check ([#94](https://github.com/browserbase/sdk-python/issues/94)) ([de5856d](https://github.com/browserbase/sdk-python/commit/de5856dac77567813f681615bef7d147e505a6a0))
25+
* **internal:** add support for TypeAliasType ([#85](https://github.com/browserbase/sdk-python/issues/85)) ([64448c6](https://github.com/browserbase/sdk-python/commit/64448c6e020aaeb4b39b7ec8f1b28a6b8f0c746a))
26+
* **internal:** bump httpx dependency ([#95](https://github.com/browserbase/sdk-python/issues/95)) ([d592266](https://github.com/browserbase/sdk-python/commit/d592266e85c40d14e4929089f8ae4db814d04ce7))
27+
* **internal:** bump pydantic dependency ([#81](https://github.com/browserbase/sdk-python/issues/81)) ([e35a0d8](https://github.com/browserbase/sdk-python/commit/e35a0d85ef0e45aed1a5f58757427bf7c16a76f5))
28+
* **internal:** bump pyright ([#83](https://github.com/browserbase/sdk-python/issues/83)) ([894b4c4](https://github.com/browserbase/sdk-python/commit/894b4c45b0c36963822923535391aa34dbfec766))
29+
* **internal:** codegen related update ([#102](https://github.com/browserbase/sdk-python/issues/102)) ([f648bbb](https://github.com/browserbase/sdk-python/commit/f648bbbae4520a1003ecaf5cbd299da9aabfb90f))
30+
* **internal:** codegen related update ([#106](https://github.com/browserbase/sdk-python/issues/106)) ([3fc9cde](https://github.com/browserbase/sdk-python/commit/3fc9cde212c1ea7f1010c9e688bd75841d828ace))
31+
* **internal:** codegen related update ([#107](https://github.com/browserbase/sdk-python/issues/107)) ([c97e138](https://github.com/browserbase/sdk-python/commit/c97e1383ac673d05861653c0818c1d1c5b0fa5c8))
32+
* **internal:** codegen related update ([#86](https://github.com/browserbase/sdk-python/issues/86)) ([ab76578](https://github.com/browserbase/sdk-python/commit/ab76578bdce5eba2410b09f497758fbf0e0d8cf0))
33+
* **internal:** codegen related update ([#87](https://github.com/browserbase/sdk-python/issues/87)) ([f7f189e](https://github.com/browserbase/sdk-python/commit/f7f189ec317394f2fc532b8f95c3d15304298027))
34+
* **internal:** codegen related update ([#88](https://github.com/browserbase/sdk-python/issues/88)) ([85f1492](https://github.com/browserbase/sdk-python/commit/85f1492efc58d86ebc34511ca1269a0db2a4d223))
35+
* **internal:** codegen related update ([#93](https://github.com/browserbase/sdk-python/issues/93)) ([57f0977](https://github.com/browserbase/sdk-python/commit/57f0977c8e050b85b2c2de91202f6775299f80bf))
36+
* **internal:** codegen related update ([#99](https://github.com/browserbase/sdk-python/issues/99)) ([f817bcb](https://github.com/browserbase/sdk-python/commit/f817bcb67c2080a954c476c15dc048c2c628243a))
37+
* **internal:** fix some typos ([#92](https://github.com/browserbase/sdk-python/issues/92)) ([51d9f42](https://github.com/browserbase/sdk-python/commit/51d9f42a32d17d2d2277eb8a7b8f35a980c7c485))
38+
* **internal:** minor formatting changes ([#110](https://github.com/browserbase/sdk-python/issues/110)) ([195c595](https://github.com/browserbase/sdk-python/commit/195c595bfbe2ed97ae4b551658618f4a99a255f0))
39+
* **internal:** remove some duplicated imports ([#89](https://github.com/browserbase/sdk-python/issues/89)) ([a82ae7d](https://github.com/browserbase/sdk-python/commit/a82ae7d418b1daf68c85e70dea61e628eb785b79))
40+
* **internal:** updated imports ([#90](https://github.com/browserbase/sdk-python/issues/90)) ([dc6e187](https://github.com/browserbase/sdk-python/commit/dc6e187bfe9585692b2de1b67fc83f027a52c43c))
41+
* make the `Omit` type public ([#78](https://github.com/browserbase/sdk-python/issues/78)) ([a7bdc57](https://github.com/browserbase/sdk-python/commit/a7bdc57ab7f327da61121986ba7b006238d0e5b5))
42+
43+
44+
### Documentation
45+
46+
* fix typos ([#98](https://github.com/browserbase/sdk-python/issues/98)) ([d4f4bae](https://github.com/browserbase/sdk-python/commit/d4f4bae46341e91ac537e121bba38e511c7026bc))
47+
* **readme:** example snippet for client context manager ([#91](https://github.com/browserbase/sdk-python/issues/91)) ([950c8af](https://github.com/browserbase/sdk-python/commit/950c8af19db4581fabd5b965ca4f0af3cc5cd6dc))
48+
* **readme:** fix http client proxies example ([#82](https://github.com/browserbase/sdk-python/issues/82)) ([cc67c77](https://github.com/browserbase/sdk-python/commit/cc67c773b11b42b406b677f466c7c0ef090b254e))
49+
350
## 1.0.5 (2024-12-03)
451

552
Full Changelog: [v1.0.4...v1.0.5](https://github.com/browserbase/sdk-python/compare/v1.0.4...v1.0.5)

Diff for: LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2024 Browserbase
189+
Copyright 2025 Browserbase
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

Diff for: README.md

+19-10
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ session = client.sessions.create(
4141
)
4242
print(session.id)
4343

44+
4445
def run(playwright: Playwright) -> None:
4546
# Connect to the remote session
4647
chromium = playwright.chromium
@@ -51,9 +52,7 @@ def run(playwright: Playwright) -> None:
5152
# Execute Playwright actions on the remote browser tab
5253
page.goto("https://news.ycombinator.com/")
5354
page_title = page.title()
54-
assert (
55-
page_title == "Hacker News"
56-
), f"Page title is not 'Hacker News', it is '{page_title}'"
55+
assert page_title == "Hacker News", f"Page title is not 'Hacker News', it is '{page_title}'"
5756
page.screenshot(path="screenshot.png")
5857

5958
page.close()
@@ -121,7 +120,7 @@ except browserbase.APIStatusError as e:
121120
print(e.response)
122121
```
123122

124-
Error codes are as followed:
123+
Error codes are as follows:
125124

126125
| Status Code | Error Type |
127126
| ----------- | -------------------------- |
@@ -260,8 +259,7 @@ If you need to access undocumented endpoints, params, or response properties, th
260259
#### Undocumented endpoints
261260

262261
To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
263-
http verbs. Options on the client will be respected (such as retries) will be respected when making this
264-
request.
262+
http verbs. Options on the client will be respected (such as retries) when making this request.
265263

266264
```py
267265
import httpx
@@ -290,18 +288,19 @@ can also get all the extra fields on the Pydantic model as a dict with
290288

291289
You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:
292290

293-
- Support for proxies
294-
- Custom transports
291+
- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)
292+
- Custom [transports](https://www.python-httpx.org/advanced/transports/)
295293
- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality
296294

297295
```python
296+
import httpx
298297
from browserbase import Browserbase, DefaultHttpxClient
299298

300299
client = Browserbase(
301300
# Or use the `BROWSERBASE_BASE_URL` env var
302301
base_url="http://my.test.server.example.com:8083",
303302
http_client=DefaultHttpxClient(
304-
proxies="http://my.test.proxy.example.com",
303+
proxy="http://my.test.proxy.example.com",
305304
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
306305
),
307306
)
@@ -317,12 +316,22 @@ client.with_options(http_client=DefaultHttpxClient(...))
317316

318317
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
319318

319+
```py
320+
from browserbase import Browserbase
321+
322+
with Browserbase() as client:
323+
# make requests here
324+
...
325+
326+
# HTTP client is now closed
327+
```
328+
320329
## Versioning
321330

322331
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
323332

324333
1. Changes that only affect static types, without breaking runtime behavior.
325-
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
334+
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
326335
3. Changes that we do not expect to impact the vast majority of users in practice.
327336

328337
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

Diff for: examples/e2e/test_playwright.py

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def playwright() -> Generator[Playwright, None, None]:
2929
with sync_playwright() as p:
3030
yield p
3131

32+
3233
def test_playwright_basic(playwright: Playwright) -> None:
3334
playwright_basic.run(playwright)
3435

Diff for: examples/playwright_basic.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ def run(playwright: Playwright) -> None:
1919
# Execute Playwright actions on the remote browser tab
2020
page.goto("https://news.ycombinator.com/")
2121
page_title = page.title()
22-
assert (
23-
page_title == "Hacker News"
24-
), f"Page title is not 'Hacker News', it is '{page_title}'"
22+
assert page_title == "Hacker News", f"Page title is not 'Hacker News', it is '{page_title}'"
2523
page.screenshot(path="screenshot.png")
2624

2725
page.close()

Diff for: examples/playwright_captcha.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ def handle_console(msg: ConsoleMessage) -> None:
3434
page.on("console", handle_console)
3535

3636
page.goto(DEFAULT_CAPTCHA_URL, wait_until="networkidle")
37-
page.wait_for_function(
38-
"() => window.captchaSolvingFinished === true", timeout=OVERRIDE_TIMEOUT
39-
)
37+
page.wait_for_function("() => window.captchaSolvingFinished === true", timeout=OVERRIDE_TIMEOUT)
4038

4139
assert captcha_solving_started, "Captcha solving did not start"
4240
assert captcha_solving_finished, "Captcha solving did not finish"

Diff for: examples/playwright_contexts.py

+4-12
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,11 @@ def run(playwright: Playwright) -> None:
4141
# Step 2: Creates a session with the context
4242
session = bb.sessions.create(
4343
project_id=BROWSERBASE_PROJECT_ID,
44-
browser_settings=TypeAdapter(BrowserSettings).validate_python(
45-
{"context": {"id": context_id, "persist": True}}
46-
),
44+
browser_settings=TypeAdapter(BrowserSettings).validate_python({"context": {"id": context_id, "persist": True}}),
4745
)
4846
print(session)
4947

50-
assert (
51-
session.context_id == context_id
52-
), f"Session context_id is {session.context_id}, expected {context_id}"
48+
assert session.context_id == context_id, f"Session context_id is {session.context_id}, expected {context_id}"
5349
session_id = session.id
5450

5551
# Step 3: Populates and persists the context
@@ -90,13 +86,9 @@ def run(playwright: Playwright) -> None:
9086
# Step 4: Creates another session with the same context
9187
session = bb.sessions.create(
9288
project_id=BROWSERBASE_PROJECT_ID,
93-
browser_settings=BrowserSettings(
94-
context=BrowserSettingsContext(id=context_id, persist=True)
95-
),
89+
browser_settings=BrowserSettings(context=BrowserSettingsContext(id=context_id, persist=True)),
9690
)
97-
assert (
98-
session.context_id == context_id
99-
), f"Session context_id is {session.context_id}, expected {context_id}"
91+
assert session.context_id == context_id, f"Session context_id is {session.context_id}, expected {context_id}"
10092
session_id = session.id
10193

10294
# Step 5: Uses context to find previous state

Diff for: examples/playwright_extensions.py

+5-15
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
)
1313
from browserbase.types import Extension, SessionCreateResponse
1414

15-
PATH_TO_EXTENSION = (
16-
Path.cwd() / "examples" / "packages" / "extensions" / "browserbase-test"
17-
)
15+
PATH_TO_EXTENSION = Path.cwd() / "examples" / "packages" / "extensions" / "browserbase-test"
1816

1917

2018
def zip_extension(path: Path = PATH_TO_EXTENSION, save_local: bool = False) -> BytesIO:
@@ -23,9 +21,7 @@ def zip_extension(path: Path = PATH_TO_EXTENSION, save_local: bool = False) -> B
2321
Mark save_local=True to save the zip file to a local file.
2422
"""
2523
# Ensure we're looking at an extension
26-
assert "manifest.json" in os.listdir(
27-
path
28-
), "No manifest.json found in the extension folder."
24+
assert "manifest.json" in os.listdir(path), "No manifest.json found in the extension folder."
2925

3026
# Create a BytesIO object to hold the zip file in memory
3127
memory_zip = BytesIO()
@@ -51,9 +47,7 @@ def zip_extension(path: Path = PATH_TO_EXTENSION, save_local: bool = False) -> B
5147

5248
def create_extension() -> str:
5349
zip_data = zip_extension(save_local=True)
54-
extension: Extension = bb.extensions.create(
55-
file=("extension.zip", zip_data.getvalue())
56-
)
50+
extension: Extension = bb.extensions.create(file=("extension.zip", zip_data.getvalue()))
5751
return extension.id
5852

5953

@@ -75,9 +69,7 @@ def check_for_message(page: Page, message: str) -> None:
7569
while time.time() - start < 10:
7670
if message in console_messages:
7771
break
78-
assert (
79-
message in console_messages
80-
), f"Expected message not found in console logs. Messages: {console_messages}"
72+
assert message in console_messages, f"Expected message not found in console logs. Messages: {console_messages}"
8173

8274

8375
def run(playwright: Playwright) -> None:
@@ -141,9 +133,7 @@ def run(playwright: Playwright) -> None:
141133
project_id=BROWSERBASE_PROJECT_ID,
142134
extension_id=extension_id,
143135
)
144-
raise AssertionError(
145-
"Expected to fail when creating session with deleted extension"
146-
)
136+
raise AssertionError("Expected to fail when creating session with deleted extension")
147137
except Exception as e:
148138
print(f"Failed to create session with deleted extension as expected: {str(e)}")
149139

Diff for: examples/playwright_proxy.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212

1313
def check_proxy_bytes(session_id: str) -> None:
14-
bb.sessions.update(
15-
id=session_id, project_id=BROWSERBASE_PROJECT_ID, status="REQUEST_RELEASE"
16-
)
14+
bb.sessions.update(id=session_id, project_id=BROWSERBASE_PROJECT_ID, status="REQUEST_RELEASE")
1715
time.sleep(GRACEFUL_SHUTDOWN_TIMEOUT / 1000)
1816
updated_session = bb.sessions.retrieve(id=session_id)
1917
assert (

Diff for: examples/playwright_upload.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,8 @@ def run(playwright: Playwright) -> None:
3333
file_size = int(file_size_span.inner_text())
3434

3535
# Assert the file name and size
36-
assert (
37-
file_name == "logo.png"
38-
), f"Expected file name to be 'logo.png', but got '{file_name}'"
39-
assert (
40-
file_size > 0
41-
), f"Expected file size to be greater than 0, but got {file_size}"
36+
assert file_name == "logo.png", f"Expected file name to be 'logo.png', but got '{file_name}'"
37+
assert file_size > 0, f"Expected file size to be greater than 0, but got {file_size}"
4238

4339
print("File upload test passed successfully!")
4440

Diff for: examples/selenium_basic.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ def run() -> None:
3434
session = bb.sessions.create(project_id=BROWSERBASE_PROJECT_ID)
3535
connection = BrowserbaseConnection(session.id, session.selenium_remote_url)
3636
driver = webdriver.Remote(
37-
command_executor=connection, options=webdriver.ChromeOptions() # type: ignore
37+
command_executor=connection,
38+
options=webdriver.ChromeOptions(), # type: ignore
3839
)
3940

4041
# Print a bit of info about the browser we've connected to

Diff for: mypy.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ cache_fine_grained = True
4141
# ```
4242
# Changing this codegen to make mypy happy would increase complexity
4343
# and would not be worth it.
44-
disable_error_code = func-returns-value
44+
disable_error_code = func-returns-value,overload-cannot-match
4545

4646
# https://github.com/python/mypy/issues/12162
4747
[mypy.overrides]

Diff for: pyproject.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "browserbase"
3-
version = "1.0.5"
3+
version = "1.1.0"
44
description = "The official Python library for the Browserbase API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -10,7 +10,7 @@ authors = [
1010
dependencies = [
1111
"httpx>=0.23.0, <1",
1212
"pydantic>=1.9.0, <3",
13-
"typing-extensions>=4.7, <5",
13+
"typing-extensions>=4.10, <5",
1414
"anyio>=3.5.0, <5",
1515
"distro>=1.7.0, <2",
1616
"sniffio",
@@ -138,6 +138,7 @@ testpaths = ["tests"]
138138
addopts = "--tb=short"
139139
xfail_strict = true
140140
asyncio_mode = "auto"
141+
asyncio_default_fixture_loop_scope = "session"
141142
filterwarnings = [
142143
"error"
143144
]

0 commit comments

Comments
 (0)