Skip to content

docs(cli): document the two base-url env vars the CLI reads - #2980

Open
Navesz wants to merge 1 commit into
browserbase:mainfrom
Navesz:docs-cli-base-url-vars
Open

Navesz wants to merge 1 commit into
browserbase:mainfrom
Navesz:docs-cli-base-url-vars

Conversation

@Navesz

@Navesz Navesz commented Sep 18, 2026

Copy link
Copy Markdown

What

Two rows in the ## Configuration env-var table of packages/cli/README.md.

Why

The table reads as the list of variables browse honors, and it omits two that the CLI does read. Both change which Browserbase deployment the CLI talks to, so a user who does not know they are set — or who sets one expecting nothing to happen — silently hits a different endpoint.

Where they are read on main:

  • packages/cli/src/lib/cloud/api.ts:72return args.baseUrl ?? process.env.BROWSERBASE_BASE_URL;, which feeds createBrowserbaseClient and resolveApiBaseUrl
  • packages/cli/src/lib/functions/shared.ts:31-34args.baseUrl || process.env.BROWSERBASE_BASE_URL || process.env.BROWSERBASE_API_BASE_URL || defaultFunctionsBaseUrl

Checked in the published artifact too, not only in the source — npm pack browse@0.9.6:

$ grep -rho "BROWSERBASE_BASE_URL\|BROWSERBASE_API_BASE_URL" package/ | sort | uniq -c
      1 BROWSERBASE_API_BASE_URL
      2 BROWSERBASE_BASE_URL
$ grep -c "BROWSERBASE_BASE_URL" package/README.md
0

So the shipped CLI honors them and the shipped README documents neither.

The precedence in the rows follows the code: the --base-url flag wins over both, and BROWSERBASE_API_BASE_URL is only consulted by browse functions, after BROWSERBASE_BASE_URL.

One thing worth a maintainer's eye: packages/docs/v4/first-steps/installation.mdx:56 tells users to pass URLs explicitly "rather than setting BROWSERBASE_BASE_URL". That text scopes itself to the SDKs, and the CLI is a separate surface — but if the intent is that the CLI should not read the variable either, then the fix is in the code rather than in this table, and I am happy to close this.

Docs only; no code, no behaviour change.

🤖 Generated with Claude Code


Summary by cubic

Documents two base-URL env vars the CLI already reads but did not list, so users can now tell which Browserbase endpoint browse will talk to.

  • Adds BROWSERBASE_BASE_URL and BROWSERBASE_API_BASE_URL rows to the Configuration table.
  • Notes precedence: --base-url wins over both, and BROWSERBASE_API_BASE_URL only applies to browse functions, after BROWSERBASE_BASE_URL.
  • Docs only, no behavior change; the diff also normalizes line endings in the README.

Written for commit 346b803. Summary will update on new commits.

Review in cubic

BROWSERBASE_BASE_URL (cloud, sessions and functions) and
BROWSERBASE_API_BASE_URL (functions only) are read by the CLI but were
missing from the Configuration table, so a user could not tell which
endpoint browse would talk to.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 346b803

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions

Copy link
Copy Markdown
Contributor

This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run.
Approving the latest commit mirrors it into an internal PR owned by the approver.
If new commits are pushed later, the internal PR stays open but is marked stale until someone approves the latest external commit and refreshes it.

@github-actions github-actions Bot added external-contributor Tracks PRs mirrored from external contributor forks. external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. labels Sep 18, 2026

This branch has not been deployed

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

Labels

external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. external-contributor Tracks PRs mirrored from external contributor forks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant