Skip to content

Commit a074034

Browse files
authored
Merge pull request #1 from browserbase/create-session-ensure-project-id
fix(create_session): ensure a `project_id` is set
2 parents 8556c49 + fe4dd85 commit a074034

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎browserbase/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ def create_session(self, options: Optional[CreateSessionOptions] = None) -> Sess
140140
if options:
141141
payload.update(options.model_dump(by_alias=True, exclude_none=True))
142142

143+
if not options['projectId']:
144+
raise ValueError("a projectId is missing: use the options.projectId or BROWSERBASE_PROJECT_ID environment variable to set one.")
145+
143146
response = httpx.post(
144147
f"{self.api_url}/v1/sessions",
145148
headers={

0 commit comments

Comments
 (0)