Skip to content

feat(sdk): export StagehandLog from public entrypoints - #2695

Open
HaoChiBao wants to merge 2 commits into
browserbase:mainfrom
HaoChiBao:feat/export-stagehand-log
Open

feat(sdk): export StagehandLog from public entrypoints#2695
HaoChiBao wants to merge 2 commits into
browserbase:mainfrom
HaoChiBao:feat/export-stagehand-log

Conversation

@HaoChiBao

@HaoChiBao HaoChiBao commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Export StagehandLog from the public TypeScript and Python SDK entrypoints.
  • Update logging docs to import the type from the public package and drop the related TODO.
  • Add a patch Changeset for both SDKs.

Test plan

  • TypeScript: import type { StagehandLog } from @browserbasehq/stagehand resolves
  • Python: from stagehand import StagehandLog resolves and is listed in __all__
  • Logging docs examples compile / match the public API

Summary by cubic

Export StagehandLog from the public TypeScript and Python SDK entry points, and export StagehandLogLevel and StagehandLogData in Python so apps can import from the package root. Previously these types were not re-exported; there are no runtime changes.

Migration

  • TypeScript: import type { StagehandLog } from '@browserbasehq/stagehand'.
  • Python: from stagehand import StagehandLog, StagehandLogLevel, StagehandLogData.

Written for commit 8c55dff. Summary will update on new commits.

Review in cubic

Make the StagehandLog type importable from the TypeScript and Python SDKs, and update logging docs accordingly.
@HaoChiBao
HaoChiBao requested a review from a team as a code owner August 12, 2026 18:38
@changeset-bot

changeset-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8c55dff

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

This PR includes changesets to release 6 packages
Name Type
@browserbasehq/stagehand Patch
@browserbasehq/stagehand-python Patch
@browserbasehq/stagehand-integrations Patch
@browserbasehq/stagehand-integrations-example-eve-facade Patch
@browserbasehq/stagehand-integrations-example-mastra-facade Patch
@browserbasehq/stagehand-integrations-example-vercel-ai-facade 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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 4 files

Architecture diagram
sequenceDiagram
    participant App as External Application
    participant SDK as Stagehand SDK
    participant TypeDefs as Type Definitions
    participant PkgExports as Public Exports
    participant Logger as Logging Callback

    Note over App,Logger: TypeScript SDK Public API Export Flow

    App->>App: Source file imports StagehandLog<br>from package root

    alt TypeScript
        App->>PkgExports: import type { StagehandLog }<br>from "@browserbasehq/stagehand"
        PkgExports->>TypeDefs: Resolve to sdk-ts/src/index.ts
        TypeDefs-->>PkgExports: Export StagehandLog type
        PkgExports-->>App: Type available at runtime compile time
    else Python
        App->>PkgExports: from stagehand import StagehandLog
        PkgExports->>PkgExports: Check __init__.py exports
        PkgExports-->>App: StagehandLog in __all__
    end

    App->>Logger: Register logging callback
    Logger->>SDK: Initialize Stagehand client
    SDK->>Logger: Execute Stagehand operations
    Logger->>Logger: Accept log parameter typed as StagehandLog
    Logger-->>App: Structured log output
Loading

Tip: cubic used a learning from your PR history. Let your coding agent read cubic learnings directly with the cubic MCP.

Re-trigger cubic

Comment thread packages/docs/v4/configuration/logging.mdx Outdated
Export StagehandLogLevel and StagehandLogData beside StagehandLog so the logging docs sketch matches log.level.value / log.data usage.
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.

1 participant