You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: migrating.md
+127-50
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,65 @@
1
-
# Upgrade guide to v1.0
1
+
# V1 Migration Guide
2
2
3
-
The Browserbase v1.0.0 Python SDK has been rewritten from the ground up and ships with a ton of new features and better support that we can't wait for you to try. Unfortunately, however, this means that the old SDKs will be deprecated and archived in favor of the new SDK.
3
+
The Browserbase v1 Python SDK has been rewritten from the ground up and ships with a ton of new features and better support that we can't wait for you to try. This guide is designed to help you maximize your experience with V1.
4
4
5
5
We hope this guide is useful to you; if you have any questions don't hesitate to reach out to [email protected] or [create a new issue](https://github.com/browserbase/sdk-python/issues/new).
6
6
7
+
## Major Changes
8
+
9
+
V1 SDK is a complete rewrite of the old SDK. The new SDK is more flexible, easier to use, and has a more consistent API. It is also a lot more modular. The majority of the syntax changes are as follows:
10
+
11
+
```python
12
+
# Old SDK
13
+
browserbase.list_sessions()
14
+
15
+
# New SDK
16
+
bb.sessions.list()
17
+
```
18
+
19
+
### Creating a Session
20
+
21
+
Similar to the above, the new way to create a session is to use the `create` method on the `sessions` object. However, the `CreateSessionOptions` object is now broken up into several params, saving you from having to import and instantiate a Pydantic object. For more on this, see [below](#create-session).
22
+
23
+
## Deprecated Methods
24
+
25
+
`load`, `load_url`, and `screenshot` are fully deprecated. You can use the following example instead that encapsulates the same functionality using Playwright.
26
+
27
+
```python
28
+
from playwright.sync_api import Playwright, sync_playwright
`load`, `load_url`, and `screenshot` are fully deprecated. You can use the following example instead that encapsulates the same functionality using Playwright
210
-
211
-
```python
212
-
from playwright.sync_api import Playwright, sync_playwright
0 commit comments