Skip to content

feat: move base URLs to credentials for n8n Connect support#19

Open
alexander-gekov wants to merge 3 commits into
browserbase:mainfrom
alexander-gekov:feat/credential-base-urls
Open

feat: move base URLs to credentials for n8n Connect support#19
alexander-gekov wants to merge 3 commits into
browserbase:mainfrom
alexander-gekov:feat/credential-base-urls

Conversation

@alexander-gekov

@alexander-gekov alexander-gekov commented Jun 16, 2026

Copy link
Copy Markdown

Summary

  • Add hidden baseUrl (https://api.browserbase.com) and stagehandBaseUrl (https://api.stagehand.browserbase.com) fields to the browserbaseApi credential, so the base URLs can be injected/overridden at runtime (e.g. by n8n Connect, a proxy, or a regional endpoint).
  • Bump node typeVersion to 2.1 so credential-aware URL resolution is used on fresh installs, while existing nodes (typeVersion 2) keep using the hardcoded constants — no breaking change.
  • Resolve the base URLs from the credential at runtime for v2.1+, normalizing trailing slashes; update the credential test to use the credential baseUrl.

Why

n8n Connect requires the base URL to be configurable via credentials rather than hardcoded in the node. Gating on typeVersion ensures backward compatibility with nodes already saved by users (they stay on v2 and behave identically). n8n applies credential defaults at decrypt time, so existing credentials resolve to the same URLs without any migration.

This mirrors the approach used for other community nodes (e.g. PDF.co): a hidden URL field plus a typeVersion bump.

Backwards compatibility

  • Existing nodes (typeVersion 2) continue using the hardcoded constants.
  • New nodes default to typeVersion 2.1 and read the URLs from the credential (defaulted to the same values).
  • No changes to auth headers, request bodies, endpoints, or business logic.

Test plan

  • npm run lint passes
  • npm run build passes
  • Existing (v2) node: Search/Fetch/Agent behave unchanged
  • New (v2.1) node: Search/Fetch/Agent work with default credential values
  • Overriding the credential baseUrl reroutes Search/Fetch on a v2.1 node

alexander-gekov and others added 2 commits June 16, 2026 19:38
Move the hardcoded REST (api.browserbase.com) and Stagehand
(api.stagehand.browserbase.com) base URLs into the Browserbase API
credential as `baseUrl` and `stagehandBaseUrl` fields. The node now reads
these at runtime, falling back to the previous hardcoded values when unset,
so existing credentials and default behavior are unchanged.

This lets operators point the node at a proxy or regional endpoint, and
allows the base URL to be overridden by gateways/proxies that swap the
credential URL field.

Co-authored-by: Cursor <cursoragent@cursor.com>
Make the baseUrl/stagehandBaseUrl credential fields hidden and gate
credential-based URL resolution on node typeVersion: nodes at version 2
keep using the hardcoded constants, while version 2.1 (the new default)
reads the URLs from the credential. n8n applies credential defaults at
decrypt time, so existing credentials resolve to the same values.

This mirrors the pattern used by the n8n team for n8n Connect support
(hidden URL field + typeVersion bump) and guarantees existing workflows
are unaffected.

Co-authored-by: Cursor <cursoragent@cursor.com>
@alexander-gekov alexander-gekov changed the title feat: make base URLs configurable via credentials feat: move base URLs to credentials for n8n Connect support Jun 17, 2026
On v2.1 nodes, credentials saved before the hidden URL fields existed (or
otherwise lacking them) yield an undefined value, which crashed
normalizeBaseUrl. Fall back to the hardcoded constants when the credential
URL is empty so resolution never throws.

Co-authored-by: Cursor <cursoragent@cursor.com>
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