Skip to content

[STG-1808] Deprecate Browserbase project ID#2039

Open
monadoid wants to merge 2 commits intomainfrom
stg-1808-project-id-deprecation
Open

[STG-1808] Deprecate Browserbase project ID#2039
monadoid wants to merge 2 commits intomainfrom
stg-1808-project-id-deprecation

Conversation

@monadoid
Copy link
Copy Markdown
Contributor

@monadoid monadoid commented Apr 24, 2026

why

Browserbase API keys are project-scoped, so Stagehand should keep accepting project IDs without requiring them.

what changed

  • Mark browserbaseSessionCreateParams.projectId deprecated in Zod/OpenAPI.
  • Make BROWSERBASE_PROJECT_ID nullable/deprecated in Stainless config.
  • Use Browserbase-returned projectId in the local server instead of x-bb-project-id.
projectId: z.string().optional().meta({ deprecated: true })

test plan

  • pnpm --filter @browserbasehq/stagehand run lint
  • pnpm --filter @browserbasehq/stagehand-server-v3 run lint

Summary by cubic

Deprecate Browserbase project ID per STG-1808; Stagehand now relies on project-scoped API keys and the project ID returned by Browserbase. The x-bb-project-id header, session projectId param, and BROWSERBASE_PROJECT_ID config are deprecated but remain optional for now.

  • Refactors

    • Marked projectId in session create params as deprecated in Zod/OpenAPI; updated security scheme descriptions to reflect deprecation of x-bb-project-id.
    • Made BROWSERBASE_PROJECT_ID nullable and marked deprecated in stainless.yml.
    • Server now resolves projectId from the retrieved/created Browserbase session; stops reading x-bb-project-id and adjusts validation messages.
  • Migration

    • Stop sending x-bb-project-id and remove BROWSERBASE_PROJECT_ID; they’re no longer needed.
    • Avoid passing projectId in session creation; it’s accepted but deprecated.

Written for commit 5ee90b8. Summary will update on new commits. Review in cubic

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 24, 2026

🦋 Changeset detected

Latest commit: 870503e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@browserbasehq/stagehand-server-v3 Patch
@browserbasehq/stagehand Patch
@browserbasehq/stagehand-evals Patch
@browserbasehq/stagehand-server-v4 Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

✱ Stainless preview builds

This PR will update the stagehand SDKs with the following commit message.

feat: [STG-1808] Deprecate Browserbase project ID

Edit this comment to update it. It will appear in the SDK's changelogs.

stagehand-php studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ⚠️lint ✅test ✅

New diagnostics (1 note)
💡 Schema/DeprecatedWithoutMessage: Confirm schema is deprecated and add missing deprecation details if needed.
stagehand-openapi studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ✅

New diagnostics (1 note)
💡 Schema/DeprecatedWithoutMessage: Confirm schema is deprecated and add missing deprecation details if needed.
stagehand-ruby studio · conflict

Your SDK build had at least one new note diagnostic, which is a regression from the base state.

New diagnostics (1 note)
💡 Schema/DeprecatedWithoutMessage: Confirm schema is deprecated and add missing deprecation details if needed.
stagehand-go studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ✅build ✅ (prev: build ⏭️) → lint ✅test ✅

go get github.com/stainless-sdks/stagehand-go@f8d108479ea1d9950f1c91eb60bcaa253c7cff3c
New diagnostics (1 note)
💡 Schema/DeprecatedWithoutMessage: Confirm schema is deprecated and add missing deprecation details if needed.
stagehand-java studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ✅build ✅ (prev: build ⏭️) → lint ✅ (prev: lint ⏭️) → test ✅

Add the following URL as a Maven source: 'https://pkg.stainless.com/s/stagehand-java/51baeefeda0a79f6a69ff0c925dfae866d9fe43b/mvn'
New diagnostics (1 note)
💡 Schema/DeprecatedWithoutMessage: Confirm schema is deprecated and add missing deprecation details if needed.
stagehand-kotlin studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ✅build ✅ (prev: build ⏭️) → lint ✅ (prev: lint ⏭️) → test ✅

New diagnostics (1 note)
💡 Schema/DeprecatedWithoutMessage: Confirm schema is deprecated and add missing deprecation details if needed.
⚠️ stagehand-csharp studio · code · diff

Your SDK build had a failure in the build CI job, which is a regression from the base state.
generate ⚠️build ❗ (prev: build ⏭️) → lint ❗ (prev: lint ⏭️) → test ✅

New diagnostics (1 note)
💡 Schema/DeprecatedWithoutMessage: Confirm schema is deprecated and add missing deprecation details if needed.
⚠️ stagehand-typescript studio · code · diff

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ⚠️build ✅ (prev: build ⏭️) → lint ❗ (prev: lint ⏭️) → test ✅

npm install https://pkg.stainless.com/s/stagehand-typescript/20c258d0827e550de23f76b26e3ce4d3d02903d3/dist.tar.gz
New diagnostics (1 note)
💡 Schema/DeprecatedWithoutMessage: Confirm schema is deprecated and add missing deprecation details if needed.
stagehand-python studio · conflict

Your SDK build resulted in a merge conflict between your custom code and the newly generated changes, which is a regression from the base state.
You don't need to resolve this conflict right now, but you will need to resolve it for your changes to be released to your users. Read more about why this happened here.


This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-04-30 15:52:51 UTC

@monadoid monadoid marked this pull request as ready for review April 30, 2026 17:39
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 6 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant Client
    participant Server as Stagehand Server (v3)
    participant BB as Browserbase API

    Note over Client,BB: Session Initialization Flow

    Client->>Server: POST /v1/sessions/start
    Note right of Client: Header: x-bb-api-key<br/>Optional: x-bb-project-id (DEPRECATED)

    alt Session ID provided
        Server->>BB: GET /sessions/{id}
        BB-->>Server: Return Session Object (id, projectId, connectUrl)
        Server->>Server: CHANGED: Extract projectId from BB response
    else New Session
        Server->>Server: Prepare Create Payload
        Note right of Server: DEPRECATED: projectId from params/headers<br/>no longer prioritized
        Server->>BB: POST /sessions (create)
        BB-->>Server: Return Session Object (id, projectId, connectUrl)
        Server->>Server: CHANGED: Extract projectId from BB response
    end

    alt Validation
        Server->>Server: Ensure browserbaseApiKey & resolved projectId exist
    else Missing Credentials
        Server-->>Client: 400 Bad Request
    end

    Note over Server: Initialize streaming context with<br/>resolved browserbaseProjectId

    Server-->>Client: 201 Created (Session Details)

    Note over Client,BB: Streaming / Command Execution

    Client->>Server: POST /v1/requests (stream)
    Server->>Server: CHANGED: Use resolved projectId (not from headers)
    Server->>BB: Connect to session via connectUrl
    BB-->>Server: WebSocket / Stream data
    Server-->>Client: Response Stream
Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants