@base44-preview/sdk 0.8.53-pr.328.3b9beb7 → 0.8.53-pr.330.2d53a0c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.js CHANGED
@@ -3,7 +3,6 @@ import { createEntitiesModule } from "./modules/entities.js";
3
3
  import { createIntegrationsModule } from "./modules/integrations.js";
4
4
  import { createAuthModule } from "./modules/auth.js";
5
5
  import { createSsoModule } from "./modules/sso.js";
6
- import { createBrowserModule } from "./modules/browser.js";
7
6
  import { createConnectorsModule, createUserConnectorsModule, } from "./modules/connectors.js";
8
7
  import { getAccessToken } from "./utils/auth-utils.js";
9
8
  import { createFetchWithAuth } from "./utils/fetch-with-auth.js";
@@ -227,7 +226,6 @@ export function createClient(config) {
227
226
  }),
228
227
  integrations: createIntegrationsModule(serviceRoleAxiosClient, appId),
229
228
  sso: createSsoModule(serviceRoleAxiosClient, appId),
230
- browser: createBrowserModule(serviceRoleAxiosClient),
231
229
  connectors: createConnectorsModule(serviceRoleAxiosClient, appId),
232
230
  functions: createFunctionsModule(serviceRoleFunctionsAxiosClient, appId, {
233
231
  getAuthHeaders: () => {
@@ -2,7 +2,6 @@ import type { EntitiesModule } from "./modules/entities.types.js";
2
2
  import type { IntegrationsModule } from "./modules/integrations.types.js";
3
3
  import type { AuthModule } from "./modules/auth.types.js";
4
4
  import type { SsoModule } from "./modules/sso.types.js";
5
- import type { BrowserModule } from "./modules/browser.types.js";
6
5
  import type { ConnectorsModule, UserConnectorsModule } from "./modules/connectors.types.js";
7
6
  import type { FunctionsModule } from "./modules/functions.types.js";
8
7
  import type { AgentsModule } from "./modules/agents.types.js";
@@ -226,8 +225,6 @@ export interface Base44Client {
226
225
  aiGateway: AiGatewayModule;
227
226
  /** {@link AppLogsModule | App logs module} with elevated permissions. */
228
227
  appLogs: AppLogsModule;
229
- /** {@link BrowserModule | Browser module} for remote browser sessions. */
230
- browser: BrowserModule;
231
228
  /** {@link ConnectorsModule | Connectors module} for OAuth token retrieval. */
232
229
  connectors: ConnectorsModule;
233
230
  /** {@link EntitiesModule | Entities module} with elevated permissions. */
package/dist/index.d.ts CHANGED
@@ -14,7 +14,6 @@ export type { AppLogsModule } from "./modules/app-logs.types.js";
14
14
  export type { AppModule, AppPublicSettings, AppPublicSettingsResponse, } from "./modules/app.types.js";
15
15
  export type { ActorsModule, ActorClient, ActorRef, Connection, ActorSubscription, ActorConnectOptions, ActorNameRegistry, ActorRegistry, } from "./modules/actors.types.js";
16
16
  export type { SsoModule, SsoAccessTokenResponse } from "./modules/sso.types.js";
17
- export type { BrowserModule, BrowserSession, BrowserSessionOptions, } from "./modules/browser.types.js";
18
17
  export { Actor, type Conn } from "./actor.js";
19
18
  export type { ConnectorsModule, UserConnectorsModule, ConnectorApiRequest, ConnectorApiResponse, ConnectorApiResponsePhase, } from "./modules/connectors.types.js";
20
19
  export type { CustomIntegrationsModule, CustomIntegrationCallParams, CustomIntegrationCallResponse, } from "./modules/custom-integrations.types.js";
@@ -5,8 +5,9 @@ export interface AiGatewayConnection {
5
5
  /** Base URL of the selected gateway provider. */
6
6
  baseURL: string;
7
7
  /**
8
- * Bearer token that authenticates the request. Empty string when the caller is
9
- * unauthenticated.
8
+ * Bearer token that authenticates the request: the service-role token from
9
+ * `base44.asServiceRole.aiGateway`, or the signed-in user's token from
10
+ * `base44.aiGateway`. The gateway expects the service-role token.
10
11
  */
11
12
  token: string;
12
13
  /**
@@ -91,8 +92,8 @@ export interface AiGatewayModuleConfig {
91
92
  *
92
93
  * The mode determines which token `connection()` returns:
93
94
  *
94
- * - **User authentication** (`base44.aiGateway`): Returns the signed-in app user's token.
95
- * - **Service role authentication** (`base44.asServiceRole.aiGateway`): Returns the service-role token instead. Use it from backend functions: apps that restrict Core integrations, the default for new apps, reject user-token gateway calls on public apps. It also works when there's no signed-in user, such as from a scheduled automation.
95
+ * - **Service role authentication** (`base44.asServiceRole.aiGateway`): Returns the app's service-role token. Use it server-side; the gateway rejects other calls with a `403` and the error code `ai_gateway_requires_service_role`. It also works with no signed-in user, such as from a scheduled automation.
96
+ * - **User authentication** (`base44.aiGateway`): Returns the signed-in app user's token. The gateway accepts it only on apps shared privately or with your workspace.
96
97
  *
97
98
  * ## Billing and limits
98
99
  *
@@ -19,7 +19,7 @@ export type IntegrationEndpointFunction = (data: Record<string, any>) => Promise
19
19
  * ```typescript
20
20
  * await base44.integrations.Core.InvokeLLM({
21
21
  * prompt: 'Explain quantum computing',
22
- * model: 'gpt_5'
22
+ * model: 'gemini_3_8_flash'
23
23
  * });
24
24
  * ```
25
25
  *
@@ -43,9 +43,9 @@ export interface InvokeLLMParams {
43
43
  prompt: string;
44
44
  /** Optionally specify a model to override the app-level model setting for this specific call.
45
45
  *
46
- * Options: `"gpt_5_mini"`, `"gemini_3_flash"`, `"gpt_5_4"`, `"gpt_5_6_sol"`, `"gpt_5_6_luna"`, `"gemini_3_1_pro"`, `"claude_sonnet_4_6"`, `"claude_opus_4_6"`, `"claude_opus_4_7"`, `"claude_opus_4_8"`, `"claude-sonnet-5"`
46
+ * Options: `"gemini_3_8_flash"`, `"gpt_6_luna"`, `"claude-sonnet-5"`, `"claude_opus_5_5"`, `"gpt_6_sol"`, `"gpt_6_astra"`, `"claude_fable_5_1"`, `"glm_5_2"`, `"gemini_3_1_pro"`, `"gpt_5_4"`, `"claude_sonnet_4_6"`, `"claude_opus_4_6"`, `"claude_opus_4_7"`, `"claude_opus_4_8"`, `"claude_opus_5"`, `"gpt_5_6_terra"`, `"gpt_5_6_sol"`, `"gpt_5_6_luna"`
47
47
  */
48
- model?: 'gpt_5_mini' | 'gemini_3_flash' | 'gpt_5_4' | 'gpt_5_6_sol' | 'gpt_5_6_luna' | 'gemini_3_1_pro' | 'claude_sonnet_4_6' | 'claude_opus_4_6' | 'claude_opus_4_7' | 'claude_opus_4_8' | 'claude-sonnet-5';
48
+ model?: 'gemini_3_8_flash' | 'gpt_6_luna' | 'claude-sonnet-5' | 'claude_opus_5_5' | 'gpt_6_sol' | 'gpt_6_astra' | 'claude_fable_5_1' | 'glm_5_2' | 'gemini_3_1_pro' | 'gpt_5_4' | 'claude_sonnet_4_6' | 'claude_opus_4_6' | 'claude_opus_4_7' | 'claude_opus_4_8' | 'claude_opus_5' | 'gpt_5_6_terra' | 'gpt_5_6_sol' | 'gpt_5_6_luna';
49
49
  /** If set to `true`, the LLM will use Google Search, Maps, and News to gather real-time context before answering.
50
50
  * @default false
51
51
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.8.53-pr.328.3b9beb7",
3
+ "version": "0.8.53-pr.330.2d53a0c",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,10 +0,0 @@
1
- import { AxiosInstance } from "axios";
2
- import { BrowserModule } from "./browser.types.js";
3
- /**
4
- * Creates the Browser module for the Base44 SDK.
5
- *
6
- * @param axios - Axios instance (should be service role client)
7
- * @returns Browser module with methods to create remote browser sessions
8
- * @internal
9
- */
10
- export declare function createBrowserModule(axios: AxiosInstance): BrowserModule;
@@ -1,28 +0,0 @@
1
- /**
2
- * Creates the Browser module for the Base44 SDK.
3
- *
4
- * @param axios - Axios instance (should be service role client)
5
- * @returns Browser module with methods to create remote browser sessions
6
- * @internal
7
- */
8
- export function createBrowserModule(axios) {
9
- return {
10
- async getSession(options = {}) {
11
- var _a;
12
- // The app is derived from the service token, so the route isn't app-scoped.
13
- const response = await axios.post("/v1/browser-sessions", { capture_debug_artifacts: (_a = options.captureDebugArtifacts) !== null && _a !== void 0 ? _a : true });
14
- const data = response;
15
- return {
16
- sessionId: data.session_id,
17
- connectionUrl: data.connection_url,
18
- connectionScope: data.connection_scope,
19
- ...(data.connection_expires_at && {
20
- connectionExpiresAt: data.connection_expires_at,
21
- }),
22
- ...(data.session_expires_at && {
23
- sessionExpiresAt: data.session_expires_at,
24
- }),
25
- };
26
- },
27
- };
28
- }
@@ -1,81 +0,0 @@
1
- /**
2
- * Options for {@linkcode BrowserModule.getSession | getSession()}.
3
- */
4
- export interface BrowserSessionOptions {
5
- /**
6
- * Whether to capture browser recordings and diagnostic logs for the session.
7
- *
8
- * Captured artifacts stay with the remote browser provider and can't be retrieved through the SDK. Defaults to `true`.
9
- */
10
- captureDebugArtifacts?: boolean;
11
- }
12
- /**
13
- * A remote browser session returned by {@linkcode BrowserModule.getSession | getSession()}.
14
- */
15
- export interface BrowserSession {
16
- /** Opaque session identifier issued by the remote browser provider. */
17
- sessionId: string;
18
- /**
19
- * Signed WebSocket URL for connecting to the browser over the Chrome DevTools Protocol (CDP).
20
- *
21
- * Treat the complete URL as a credential. Don't log it or send it to the frontend.
22
- */
23
- connectionUrl: string;
24
- /**
25
- * Scope of the CDP connection.
26
- *
27
- * - `'browser'`: The socket controls the whole browser.
28
- * - `'page'`: The socket controls a single page.
29
- */
30
- connectionScope: "browser" | "page";
31
- /** ISO 8601 timestamp when the connection URL expires. Omitted when the provider doesn't expose it. */
32
- connectionExpiresAt?: string;
33
- /** ISO 8601 timestamp when the browser session expires. Omitted when the provider doesn't expose it. */
34
- sessionExpiresAt?: string;
35
- }
36
- /**
37
- * Browser module for running browser automation from your backend.
38
- *
39
- * This module creates remote browser sessions that you can control with a CDP client library such as Playwright or Puppeteer. Base44 doesn't store browser state, so each session is independent.
40
- *
41
- * This module is only available to use with a client in service role authentication mode, which means it can only be used in backend environments.
42
- */
43
- export interface BrowserModule {
44
- /**
45
- * Creates a new remote browser session and returns its connection details.
46
- *
47
- * Each call creates a fresh session. Calls aren't retried automatically, and repeating a failed call doesn't resume a previous session. Session creation is rate limited per app.
48
- *
49
- * @param options - Optional session settings.
50
- * @returns Promise resolving to the new browser session.
51
- *
52
- * @example
53
- * ```typescript
54
- * // Open a page in a remote browser with Playwright
55
- * import { createClientFromRequest } from 'npm:@base44/sdk';
56
- * import { chromium } from 'npm:playwright-core';
57
- *
58
- * Deno.serve(async (req) => {
59
- * const base44 = createClientFromRequest(req);
60
- * const { connectionUrl } = await base44.asServiceRole.browser.getSession();
61
- *
62
- * const browser = await chromium.connectOverCDP(connectionUrl);
63
- * const page = browser.contexts()[0].pages()[0] ?? (await browser.newPage());
64
- * await page.goto('https://example.com');
65
- * const title = await page.title();
66
- * await browser.close();
67
- *
68
- * return Response.json({ title });
69
- * });
70
- * ```
71
- *
72
- * @example
73
- * ```typescript
74
- * // Turn off recordings and diagnostic logs
75
- * const session = await base44.asServiceRole.browser.getSession({
76
- * captureDebugArtifacts: false,
77
- * });
78
- * ```
79
- */
80
- getSession(options?: BrowserSessionOptions): Promise<BrowserSession>;
81
- }
@@ -1 +0,0 @@
1
- export {};