@base44-preview/platform 0.3.0-pr.340.4cdf434 → 0.3.0-pr.341.64849bb

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
@@ -19,7 +19,7 @@ import { createPlatformClient } from "@base44/platform";
19
19
 
20
20
  const client = createPlatformClient();
21
21
  const chat = client.chat.init({
22
- // Returns the body of POST /api/service/socket-sessions, unchanged.
22
+ // Returns the body of POST /api/v1/socket-sessions, unchanged.
23
23
  async getSession() {
24
24
  const response = await fetch("/api/chat-socket-session", { method: "POST" });
25
25
  if (!response.ok) throw new Error("Session request failed");
@@ -98,12 +98,13 @@ Delivery is at least once with no ordering guarantee: deduplicate on `event.id`,
98
98
  ## Sessions
99
99
 
100
100
  `/api/chat-socket-session` is your backend's route, not an SDK endpoint. It opens a
101
- socket session with its workspace key (`apps:watch` scope) through
102
- `POST /api/service/socket-sessions` with `{ app_ids }`, and returns the response body
103
- to the browser. `getSession` returns that body unchanged: the SDK reads `session_token`,
101
+ socket session through `POST /api/v1/socket-sessions` with `{ app_ids }`, and returns the
102
+ response body to the browser. It authenticates as `Authorization: Bearer` with either a
103
+ personal access token, which can watch the apps its owner can edit in its workspace, or a
104
+ workspace API key with the `apps:watch` scope. The workspace needs the Builder plan or higher. `getSession` returns that body unchanged: the SDK reads `session_token`,
104
105
  `socket_url` and `socket_path` and ignores other keys such as `session_id` and
105
- `expires_in`. Never pass the workspace key or any other server credential to this client. Subscribe only to apps on the session's allowlist; your
106
- backend adds or removes apps with `PUT`/`DELETE /api/service/socket-sessions/{session_id}/rooms/{app_id}`.
106
+ `expires_in`. Never pass the token, the workspace key or any other server credential to this client. Subscribe only to apps on the session's allowlist; your
107
+ backend adds or removes apps with `PUT`/`DELETE /api/v1/socket-sessions/{session_id}/apps/{app_id}`.
107
108
 
108
109
  A session lasts one hour and is never extended. The token goes exclusively in
109
110
  CONNECT `auth.session_token`, never a URL, and the SDK keeps it in memory only. It
@@ -32,7 +32,7 @@ export interface ToolCallAnswer {
32
32
  *
33
33
  * Base44 keeps the Send chat message and Submit tool-call input requests open until the AI
34
34
  * finishes the turn. Resolve your call once Base44 accepts the request, not when it returns. The
35
- * chat follows the rest live. A rejected promise from any call sets {@link Base44Chat.error}.
35
+ * chat follows the rest live. A rejected promise from any call sets `error` on the {@link useBase44Chat | chat}.
36
36
  *
37
37
  * @example
38
38
  * ```typescript
@@ -141,10 +141,10 @@ export interface ChatAnswer {
141
141
  * An open question, with the actions that answer this question and no other.
142
142
  *
143
143
  * Each kind carries only the actions that make sense for it, and every kind can be declined. The
144
- * actions never throw. A failure sets {@link Base44Chat.error}, and the question opens again.
144
+ * actions never throw. A failure sets `error` on the {@link useBase44Chat | chat}, and the question opens again.
145
145
  *
146
146
  * The chat declines a question kind this release doesn't know, once per tool call, when Base44
147
- * names that kind on the last assistant message. If the decline fails, {@link Base44Chat.error} says
147
+ * names that kind on the last assistant message. If the decline fails, the chat's `error` says
148
148
  * so, and the chat tries again after it reconnects.
149
149
  */
150
150
  export type ChatQuestion = ChoiceQuestion | SecretsQuestion | ApprovalQuestion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/platform",
3
- "version": "0.3.0-pr.340.4cdf434",
3
+ "version": "0.3.0-pr.341.64849bb",
4
4
  "description": "Base44 Platform SDK for white-label platforms: a browser client for following the AI chat and a server entrypoint for webhooks",
5
5
  "main": "dist/client/index.js",
6
6
  "types": "dist/client/index.d.ts",