@base44-preview/platform 0.1.0-pr.319.1e807d1 → 0.1.0-pr.319.cf89f7f

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 { createBase44PlatformClient } from "@base44/platform";
13
+ import { Base44PlatformClient } from "@base44/platform";
14
14
 
15
- const client = createBase44PlatformClient({
15
+ const client = new Base44PlatformClient({
16
16
  serverUrl: "https://base44.app",
17
17
  async getSessionToken() {
18
18
  const response = await fetch("/api/builder-socket-session", { method: "POST" });
@@ -109,7 +109,7 @@ older one, which stops with `session_replaced`. Open one session per page.
109
109
 
110
110
  ## Lifecycle
111
111
 
112
- `createBase44PlatformClient({ serverUrl, getSessionToken })` returns a lightweight module
112
+ `new Base44PlatformClient({ serverUrl, getSessionToken })` creates a lightweight module
113
113
  container: no Socket.IO instance, timers, token request or network activity. Its
114
114
  `builder` module follows the server SDK's module-factory pattern.
115
115
 
@@ -1,3 +1,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
+ 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,8 +1,9 @@
1
1
  import { normalizeServerUrl } from "../shared/server-url.js";
2
2
  import { createBuilder } from "./modules/builder.js";
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
- });
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
+ }
8
9
  }
@@ -1,4 +1,3 @@
1
- import type { BuilderModule } from "./modules/builder.types.js";
2
1
  /** Shared configuration for browser platform modules. Never supply an API key. */
3
2
  export interface PlatformClientOptions {
4
3
  /** Origin of the platform service, e.g. https://base44.app. No path/query/credentials. */
@@ -11,8 +10,3 @@ export interface PlatformClientOptions {
11
10
  */
12
11
  getSessionToken: () => string | Promise<string>;
13
12
  }
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 { createBase44PlatformClient } from "./client.js";
2
+ export { Base44PlatformClient } from "./client.js";
3
3
  export { PlatformSocketError } from "./errors.js";
4
4
  export type { PlatformSocketErrorCode } from "./errors.types.js";
5
- export type { Base44PlatformClient, PlatformClientOptions } from "./client.types.js";
5
+ export type { 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 { createBase44PlatformClient } from "./client.js";
2
+ export { Base44PlatformClient } 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.319.1e807d1",
3
+ "version": "0.1.0-pr.319.cf89f7f",
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",