Skip to main content
This page is part of an AI coding agent skill and is written for agents, not humans. For the human-readable Base44 docs, see the developer documentation.

Browser Module

Remote browser automation sessions, controllable over the Chrome DevTools Protocol (CDP).
  • base44.asServiceRole.browser — Create and end remote browser sessions (backend/service role only).

Contents


Service Role Browser (base44.asServiceRole.browser)

Runs browser automation from your backend by creating a remote browser session that you drive with a CDP client library such as Playwright or Puppeteer. Base44 doesn’t store browser state — each session is independent. Backend/service role only.

Methods

getSession(options?)

Parameters: Returns: Promise<BrowserSession> — see Type Definitions. BrowserSession.end() ends the same session. Each call creates a fresh session and uses credits from the workspace that owns the app. Sessions are billed by the minute until they end. Throws: a Base44Error with one of these code values:
  • insufficient_credits — the workspace is out of credits.
  • rate_limited — more than 100 sessions were created in the last minute.
  • browser_capacity_exceeded — browser capacity is temporarily unavailable.

endSession(sessionId)

Parameters: Returns: Promise<void>. Ending a session that already ended succeeds, so it’s safe to call more than once. Throws: a Base44Error with code: "browser_session_not_found" when the session ID wasn’t issued to your app.

Examples


Important Notes

  • Backend/service role only: browser is only available as base44.asServiceRole.browser. There’s no frontend/user-mode browser access.
  • Treat connectionUrl as a credential: it’s a signed CDP WebSocket URL — don’t log it or send it to the frontend.
  • Billing: each session uses workspace credits and is billed by the minute until it ends; always call end() (or endSession()) when done.

Type Definitions