Index of every page on this site: llms.txt
All skills
base44 avatar

/base44-sdk

@5bb6707
by base44base44/skills94 stars
21
Run it yourself

The base44 SDK is the library to communicate with base44 services. In projects, you use it to communicate with remote resources (entities, backend functions, realtime actors, ai agents, and the AI gateway for code agents, image, video, and speech generation, and AI decisions) and to write backend functions and actors. This skill is the place for learning about available modules and types, including actors — the realtime/WebSocket primitive for multiplayer, collaborative boards, presence and live cursors, in-room chat, and live auctions. When you plan or implement a feature, you must learn this skill

Use this Skill: https://skilld.dev/gh/base44/skills/base44-sdk

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesbrowser.md

≈1.5k tokens on demand. Your agent reads this file only when SKILL.md points to it.

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

Method Signature Description
getSession(options?) Promise<BrowserSession> Creates a new remote browser session and returns its connection details
endSession(sessionId) Promise<void> Ends a session from a different request than the one that created it
getSession(options?)

Parameters:

Parameter Type Description Required
options.captureDebugArtifacts boolean Whether Base44's browser provider records the session and keeps its diagnostic logs. You can't retrieve recordings/logs through the SDK — set to false when the session shows sensitive data. Defaults to true. No
options.sessionTimeoutSeconds number Maximum lifetime of the session, in whole seconds. The session ends when the timeout expires even if still in use. Clamped to between 60 and 900. Defaults to 300. No

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:

Parameter Type Description Required
sessionId string The sessionId returned by getSession(). Yes

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

// Open a page in a remote browser with Playwright
import { createClientFromRequest } from "npm:@base44/sdk";
import { chromium } from "npm:playwright-core";

Deno.serve(async (req) => {
  const base44 = createClientFromRequest(req);
  const session = await base44.asServiceRole.browser.getSession();

  try {
    const browser = await chromium.connectOverCDP(session.connectionUrl);
    const page = browser.contexts()[0]?.pages()[0] ?? (await browser.newPage());
    await page.goto("https://example.com");
    const title = await page.title();
    await browser.close();

    return Response.json({ title });
  } finally {
    await session.end();
  }
});
// Turn off recordings and diagnostic logs
const session = await base44.asServiceRole.browser.getSession({
  captureDebugArtifacts: false,
});

try {
  // Connect to session.connectionUrl and run your automation
} finally {
  await session.end();
}
// End a session from a later request, using the ID sent in the request body
import { createClientFromRequest } from "npm:@base44/sdk";

Deno.serve(async (req) => {
  const base44 = createClientFromRequest(req);
  const { sessionId } = await req.json();
  await base44.asServiceRole.browser.endSession(sessionId);

  return new Response(null, { status: 204 });
});

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

/** Options for getSession(). */
interface BrowserSessionOptions {
  /** Whether to record the session and keep diagnostic logs. Defaults to true. */
  captureDebugArtifacts?: boolean;
  /** Max session lifetime in seconds, clamped to 60–900. Defaults to 300. */
  sessionTimeoutSeconds?: number;
}

/** A remote browser session returned by getSession(). */
interface BrowserSession {
  /** Opaque session identifier. Pass to endSession() to end it from a different request. */
  sessionId: string;
  /** Signed CDP WebSocket URL. Treat as a credential — don't log or expose to the frontend. */
  connectionUrl: string;
  /** Scope of the CDP connection: 'browser' controls the whole browser, 'page' a single page. */
  connectionScope: "browser" | "page";
  /** ISO 8601 timestamp when the connection URL expires, if exposed by the provider. */
  connectionExpiresAt?: string;
  /** ISO 8601 timestamp when the session expires, if exposed by the provider. */
  sessionExpiresAt?: string;
  /** Ends the session. Equivalent to endSession(sessionId). */
  end: () => Promise<void>;
}

/** Browser module for running browser automation from the backend. Service role only. */
interface BrowserModule {
  getSession(options?: BrowserSessionOptions): Promise<BrowserSession>;
  endSession(sessionId: string): Promise<void>;
}

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warningtoday5 checks · Risk SAFE
  • Gen Agent Trust Hub1d

    The skill provides a comprehensive documentation and reference library for the Base44 JavaScript SDK. It details how to use modules for authentication, database management (entities), real-time communication (actors), and AI integration. The analysis found that the skill uses structural instructions to guide the agent between SDK and CLI tools, and all external dependencies are either vendor-owned or well-known public libraries. No malicious patterns were detected.

  • Sockettoday

    No alerts

  • Snyk1d

    Risk: MEDIUM · 2 issues

  • Runlayer8mo

    2/12 files flagged

  • ZeroLeaks7mo

    2 findings · Score: 80/100

Signed by skilld at 5bb6707. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated last week

README badge

README badge for base44/skills/base44-sdk