@base44-preview/platform 0.1.0-pr.316.3f570db → 0.1.0-pr.316.f75d775

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/README.md CHANGED
@@ -10,9 +10,9 @@ shared socket. It is independent of the app SDK (`@base44/sdk`).
10
10
  The workspace must have white-label sockets enabled; this SDK does not open sessions.
11
11
 
12
12
  ```ts
13
- import { Base44PlatformClient } from "@base44/platform";
13
+ import { createBase44PlatformClient } from "@base44/platform";
14
14
 
15
- const client = new Base44PlatformClient({
15
+ const client = createBase44PlatformClient({
16
16
  serverUrl: "https://base44.app",
17
17
  async getSessionToken() {
18
18
  const response = await fetch("/api/builder-socket-session", { method: "POST" });
@@ -55,7 +55,7 @@ older one, which stops with `session_replaced`. Open one session per page.
55
55
 
56
56
  ## Lifecycle
57
57
 
58
- `new Base44PlatformClient({ serverUrl, getSessionToken })` creates a lightweight module
58
+ `createBase44PlatformClient({ serverUrl, getSessionToken })` returns a lightweight module
59
59
  container: no Socket.IO instance, timers, token request or network activity. Its
60
60
  `builder` module follows the server SDK's module-factory pattern.
61
61
 
@@ -1,9 +1,3 @@
1
- import type { PlatformClientOptions } from "./client.types.js";
2
- import type { BuilderModule } from "./modules/builder.types.js";
3
- /** Browser platform client. Construction creates no sockets, timers or network requests. */
4
- export declare class Base44PlatformClient {
5
- /** Lazy builder subscriptions with independent session lifecycles. */
6
- readonly builder: BuilderModule;
7
- /** Configure shared service/auth settings; each module initializes its own resources. */
8
- constructor(options: PlatformClientOptions);
9
- }
1
+ import type { Base44PlatformClient, PlatformClientOptions } from "./client.types.js";
2
+ /** Create a browser platform client. Creates no sockets, timers or network requests; each module initializes its own resources. */
3
+ export declare function createBase44PlatformClient(options: PlatformClientOptions): Base44PlatformClient;
@@ -1,9 +1,8 @@
1
1
  import { normalizeServerUrl } from "../shared/server-url.js";
2
2
  import { createBuilder } from "./modules/builder.js";
3
- /** Browser platform client. Construction creates no sockets, timers or network requests. */
4
- export class Base44PlatformClient {
5
- /** Configure shared service/auth settings; each module initializes its own resources. */
6
- constructor(options) {
7
- this.builder = Object.freeze(createBuilder({ ...options, serverUrl: normalizeServerUrl(options.serverUrl) }));
8
- }
3
+ /** Create a browser platform client. Creates no sockets, timers or network requests; each module initializes its own resources. */
4
+ export function createBase44PlatformClient(options) {
5
+ return Object.freeze({
6
+ builder: Object.freeze(createBuilder({ ...options, serverUrl: normalizeServerUrl(options.serverUrl) })),
7
+ });
9
8
  }
@@ -1,3 +1,4 @@
1
+ import type { BuilderModule } from "./modules/builder.types.js";
1
2
  /** Shared configuration for browser platform modules. Never supply an API key. */
2
3
  export interface PlatformClientOptions {
3
4
  /** Origin of the platform service, e.g. https://base44.app. No path/query/credentials. */
@@ -10,3 +11,8 @@ export interface PlatformClientOptions {
10
11
  */
11
12
  getSessionToken: () => string | Promise<string>;
12
13
  }
14
+ /** Browser platform client, returned by `createBase44PlatformClient`. */
15
+ export interface Base44PlatformClient {
16
+ /** Lazy builder subscriptions with independent session lifecycles. */
17
+ readonly builder: BuilderModule;
18
+ }
@@ -1,7 +1,7 @@
1
1
  /** Browser platform modules, separate from the runtime and server SDKs. */
2
- export { Base44PlatformClient } from "./client.js";
2
+ export { createBase44PlatformClient } from "./client.js";
3
3
  export { PlatformSocketError } from "./errors.js";
4
4
  export type { PlatformSocketErrorCode } from "./errors.types.js";
5
- export type { PlatformClientOptions } from "./client.types.js";
5
+ export type { Base44PlatformClient, PlatformClientOptions } from "./client.types.js";
6
6
  export type { BuilderModule, BuilderInitOptions, BuilderSession, PlatformSubscription, SubscriptionOptions } from "./modules/builder.types.js";
7
7
  export type { AppStatus, AppStatusChanged, BranchScoped, ChatMessage, ImageResolved, MessageParams, MessageRemoved, MessageUpdated, PlatformEvent, PlatformEventMap, PreviewNavigationRequested, QueueItem, QueueUpdated, Snapshot, SnapshotQueue, TaskProgressed, ToolArguments, ToolCall, ToolDisplay, ToolEntityMutationArguments, ToolGuardApproval, ToolMediaArguments, ToolMediaResult, ToolPackageArguments, ToolPackageOperation, ToolPlanArguments, ToolPlanUpdate, ToolPrdArguments, ToolQuestion, ToolQuestionAnswer, ToolQuestionArguments, ToolQuestionInput, ToolQuestionOption, ToolSecretArguments, ToolSecretField, } from "./modules/builder.events.types.js";
@@ -1,3 +1,3 @@
1
1
  /** Browser platform modules, separate from the runtime and server SDKs. */
2
- export { Base44PlatformClient } from "./client.js";
2
+ export { createBase44PlatformClient } from "./client.js";
3
3
  export { PlatformSocketError } from "./errors.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/platform",
3
- "version": "0.1.0-pr.316.3f570db",
3
+ "version": "0.1.0-pr.316.f75d775",
4
4
  "description": "Client and server SDK for building on the Base44 platform",
5
5
  "main": "dist/client/index.js",
6
6
  "types": "dist/client/index.d.ts",