Skip to content

Commit 8526eb4

Browse files
feat(api): tweak branding and fix some config fields
1 parent ffe74fb commit 8526eb4

File tree

17 files changed

+342
-362
lines changed

17 files changed

+342
-362
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 7
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-0c12f985340be2a9287e8e01ff8733f7f2d02e019149d1ae95f1a8f8798c6690.yml
33
openapi_spec_hash: efb79934e1dc63763dd4e8493b825273
4-
config_hash: cb2b1795c195a63201c8ef7a617934d1
4+
config_hash: 1548ab91b7e8621f7fa79e8cff0c3f93

LICENSE

Lines changed: 1 addition & 1 deletion
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 2025 Stagehand
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.

README.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Stagehand Python API library
1+
# Browserbase Python API library
22

33
<!-- prettier-ignore -->
44
[![PyPI version](https://img.shields.io/pypi/v/stagehand.svg?label=pypi%20(stable))](https://pypi.org/project/stagehand/)
55

6-
The Stagehand Python library provides convenient access to the Stagehand REST API from any Python 3.9+
6+
The Browserbase Python library provides convenient access to the Browserbase REST API from any Python 3.9+
77
application. The library includes type definitions for all request params and response fields,
88
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
99

@@ -29,12 +29,12 @@ The full API of this library can be found in [api.md](api.md).
2929

3030
```python
3131
import os
32-
from stagehand import Stagehand
32+
from stagehand import Browserbase
3333

34-
client = Stagehand(
34+
client = Browserbase(
3535
api_key=os.environ.get("STAGEHAND_API_KEY"), # This is the default and can be omitted
36-
# defaults to "production".
37-
environment="environment_1",
36+
# or 'production' | 'local'; defaults to "production".
37+
environment="dev",
3838
)
3939

4040
response = client.sessions.start(
@@ -50,17 +50,17 @@ so that your API Key is not stored in source control.
5050

5151
## Async usage
5252

53-
Simply import `AsyncStagehand` instead of `Stagehand` and use `await` with each API call:
53+
Simply import `AsyncBrowserbase` instead of `Browserbase` and use `await` with each API call:
5454

5555
```python
5656
import os
5757
import asyncio
58-
from stagehand import AsyncStagehand
58+
from stagehand import AsyncBrowserbase
5959

60-
client = AsyncStagehand(
60+
client = AsyncBrowserbase(
6161
api_key=os.environ.get("STAGEHAND_API_KEY"), # This is the default and can be omitted
62-
# defaults to "production".
63-
environment="environment_1",
62+
# or 'production' | 'local'; defaults to "production".
63+
environment="dev",
6464
)
6565

6666

@@ -93,11 +93,11 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH
9393
import os
9494
import asyncio
9595
from stagehand import DefaultAioHttpClient
96-
from stagehand import AsyncStagehand
96+
from stagehand import AsyncBrowserbase
9797

9898

9999
async def main() -> None:
100-
async with AsyncStagehand(
100+
async with AsyncBrowserbase(
101101
api_key=os.environ.get("STAGEHAND_API_KEY"), # This is the default and can be omitted
102102
http_client=DefaultAioHttpClient(),
103103
) as client:
@@ -124,9 +124,9 @@ Typed requests and responses provide autocomplete and documentation within your
124124
Nested parameters are dictionaries, typed using `TypedDict`, for example:
125125

126126
```python
127-
from stagehand import Stagehand
127+
from stagehand import Browserbase
128128

129-
client = Stagehand()
129+
client = Browserbase()
130130

131131
response = client.sessions.start(
132132
env="LOCAL",
@@ -146,9 +146,9 @@ All errors inherit from `stagehand.APIError`.
146146

147147
```python
148148
import stagehand
149-
from stagehand import Stagehand
149+
from stagehand import Browserbase
150150

151-
client = Stagehand()
151+
client = Browserbase()
152152

153153
try:
154154
client.sessions.start(
@@ -187,10 +187,10 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
187187
You can use the `max_retries` option to configure or disable retry settings:
188188

189189
```python
190-
from stagehand import Stagehand
190+
from stagehand import Browserbase
191191

192192
# Configure the default for all requests:
193-
client = Stagehand(
193+
client = Browserbase(
194194
# default is 2
195195
max_retries=0,
196196
)
@@ -207,16 +207,16 @@ By default requests time out after 1 minute. You can configure this with a `time
207207
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
208208

209209
```python
210-
from stagehand import Stagehand
210+
from stagehand import Browserbase
211211

212212
# Configure the default for all requests:
213-
client = Stagehand(
213+
client = Browserbase(
214214
# 20 seconds (default is 1 minute)
215215
timeout=20.0,
216216
)
217217

218218
# More granular control:
219-
client = Stagehand(
219+
client = Browserbase(
220220
timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
221221
)
222222

@@ -236,10 +236,10 @@ Note that requests that time out are [retried twice by default](#retries).
236236

237237
We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
238238

239-
You can enable logging by setting the environment variable `STAGEHAND_LOG` to `info`.
239+
You can enable logging by setting the environment variable `BROWSERBASE_LOG` to `info`.
240240

241241
```shell
242-
$ export STAGEHAND_LOG=info
242+
$ export BROWSERBASE_LOG=info
243243
```
244244

245245
Or to `debug` for more verbose logging.
@@ -261,9 +261,9 @@ if response.my_field is None:
261261
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
262262

263263
```py
264-
from stagehand import Stagehand
264+
from stagehand import Browserbase
265265

266-
client = Stagehand()
266+
client = Browserbase()
267267
response = client.sessions.with_raw_response.start(
268268
env="LOCAL",
269269
)
@@ -339,10 +339,10 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
339339

340340
```python
341341
import httpx
342-
from stagehand import Stagehand, DefaultHttpxClient
342+
from stagehand import Browserbase, DefaultHttpxClient
343343

344-
client = Stagehand(
345-
# Or use the `STAGEHAND_BASE_URL` env var
344+
client = Browserbase(
345+
# Or use the `BROWSERBASE_BASE_URL` env var
346346
base_url="http://my.test.server.example.com:8083",
347347
http_client=DefaultHttpxClient(
348348
proxy="http://my.test.proxy.example.com",
@@ -362,9 +362,9 @@ client.with_options(http_client=DefaultHttpxClient(...))
362362
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.
363363

364364
```py
365-
from stagehand import Stagehand
365+
from stagehand import Browserbase
366366

367-
with Stagehand() as client:
367+
with Browserbase() as client:
368368
# make requests here
369369
...
370370

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ 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 Stagehand, 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
---
2222

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[project]
22
name = "stagehand"
33
version = "0.0.1"
4-
description = "The official Python library for the stagehand API"
4+
description = "The official Python library for the browserbase API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
77
authors = [
8-
{ name = "Stagehand", email = "" },
8+
{ name = "Browserbase", email = "" },
99
]
1010

1111
dependencies = [

src/stagehand/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
Client,
1111
Stream,
1212
Timeout,
13-
Stagehand,
1413
Transport,
1514
AsyncClient,
1615
AsyncStream,
17-
AsyncStagehand,
16+
Browserbase,
1817
RequestOptions,
18+
AsyncBrowserbase,
1919
)
2020
from ._models import BaseModel
2121
from ._version import __title__, __version__
@@ -27,9 +27,9 @@
2727
NotFoundError,
2828
APIStatusError,
2929
RateLimitError,
30-
StagehandError,
3130
APITimeoutError,
3231
BadRequestError,
32+
BrowserbaseError,
3333
APIConnectionError,
3434
AuthenticationError,
3535
InternalServerError,
@@ -52,7 +52,7 @@
5252
"not_given",
5353
"Omit",
5454
"omit",
55-
"StagehandError",
55+
"BrowserbaseError",
5656
"APIError",
5757
"APIStatusError",
5858
"APITimeoutError",
@@ -72,8 +72,8 @@
7272
"AsyncClient",
7373
"Stream",
7474
"AsyncStream",
75-
"Stagehand",
76-
"AsyncStagehand",
75+
"Browserbase",
76+
"AsyncBrowserbase",
7777
"ENVIRONMENTS",
7878
"file_from_path",
7979
"BaseModel",

0 commit comments

Comments
 (0)