Skip to content

preliminary support for browser automations - #328

Merged
talge-a11y merged 4 commits into
mainfrom
feat/browser-get-session
Oct 21, 2026
Merged

talge-a11y merged 4 commits into
mainfrom
feat/browser-get-session

Conversation

@talge-a11y

@talge-a11y talge-a11y commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a browser module to the SDK so backend code can run browser automation on remote browser sessions. It is available only on base44.asServiceRole.

  • getSession(options?) creates a session and returns a CDP connection URL to use with Playwright, Puppeteer or Stagehand. It also returns an end() helper.
  • endSession(sessionId) ends a session that was created in an earlier request.
  • captureDebugArtifacts turns recordings and logs on or off. It defaults to true.
  • sessionTimeoutSeconds sets a custom session timeout. The backend clamps it and applies its own default when the option is omitted.

Backend counterpart: base44-dev/apper#31752.

Testing

Unit tests in packages/sdk/tests/unit/browser.test.ts cover request mapping, option forwarding, error codes and the service-role requirement.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/sdk@0.8.55-pr.328.bc88e75

Prefer not to change any import paths? Install using npm alias so your code still imports @base44/sdk:

npm i "@base44/sdk@npm:@base44-preview/sdk@0.8.55-pr.328.bc88e75"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "@base44/sdk": "npm:@base44-preview/sdk@0.8.55-pr.328.bc88e75"
  }
}

Preview published to npm registry — try new features instantly!

@github-actions github-actions Bot added the docs-draft PR has auto-drafted documentation suggestions label Oct 14, 2026
@talge-a11y
talge-a11y force-pushed the feat/browser-get-session branch from 5f05cd2 to a6a77a6 Compare October 15, 2026 12:24

@davidsu davidsu 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.

Approved, with a few points:

  1. Release order (question). BrowserModule goes into the public docs (types-to-expose.json), but /api/v1/browser-sessions isn't on apper main yet (only on the browser_automation_* branches). If the SDK ships first, getSession() 404s for anyone following the docs. What's the plan: hold the docs exposure until the endpoint is live, or is that fine for a "preliminary" release?

  2. Naming: getSession() → createSession()? Every call creates (and bills) a fresh session, and "get" reads as idempotent. Public API names are hard to change after release, so now's the cheap moment. The brain contract test in apper would need the same rename.

  3. Timeout docs (browser.types.ts, sessionTimeoutSeconds): the backend clamps to 60–900 s, defaults to 300, and applies it as total session lifetime. Worth stating those here instead of "depending on the provider…", so users don't have to guess.

  4. nit, test (browser.test.ts:188): nock.pendingMocks() is always [] here because nothing is mocked, so it can't catch a request. nock.disableNetConnect() in this test, or a mock plus expect(scope.isDone()).toBe(false), would actually prove no request was sent.

  5. Docs example (browser.types.ts:80): does browser.contexts()[0] exist when connectionScope is 'page'? If contexts can be empty, browser.contexts()[0]?.pages()[0] ?? await browser.newPage() is safer for people who copy-paste.

I was missing context, researched and found some in #feat-browser-api and #browserbase-base44

agent: review.328

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available! (@base44/platform)


Install this PR's preview build with npm:

npm i @base44-preview/platform@0.5.0-pr.328.bc88e75

Prefer not to change any import paths? Install using npm alias so your code still imports @base44/platform:

npm i "@base44/platform@npm:@base44-preview/platform@0.5.0-pr.328.bc88e75"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "@base44/platform": "npm:@base44-preview/platform@0.5.0-pr.328.bc88e75"
  }
}

Preview published to npm registry — try new features instantly!

@talge-a11y
talge-a11y merged commit 225193b into main Oct 21, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-draft PR has auto-drafted documentation suggestions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants