Skip to content

Allow session id to be passed through env vars #760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stagehand.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const StagehandConfig: ConstructorParams = {
apiKey: process.env.BROWSERBASE_API_KEY /* API key for authentication */,
projectId: process.env.BROWSERBASE_PROJECT_ID /* Project identifier */,
browserbaseSessionID:
undefined /* Session ID for resuming Browserbase sessions */,
process.env.BROWSERBASE_SESSION_ID /* Session ID for resuming Browserbase sessions */,
browserbaseSessionCreateParams: {
projectId: process.env.BROWSERBASE_PROJECT_ID!,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Non-null assertion operator (!) used here could cause runtime errors if BROWSERBASE_PROJECT_ID is undefined

Suggested change
projectId: process.env.BROWSERBASE_PROJECT_ID!,
projectId: process.env.BROWSERBASE_PROJECT_ID,

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated to my change

Copy link
Author

@saksham-chawla saksham-chawla May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also the suggestion seems wrong since BROWSERBASE_PROJECT_ID is required env var.

browserSettings: {
Expand Down
Loading