@base44-preview/sdk 0.8.48-pr.282.86ef42a → 0.8.48-pr.282.8a4c1c0

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.
@@ -98,16 +98,11 @@ export interface AuthModuleOptions {
98
98
  * which is how the server-side SDK reports a token it never sets explicitly.
99
99
  */
100
100
  token?: string;
101
- /**
102
- * Whether this client runs embedded in a host platform's frame, where a
103
- * session is minted by the platform and cannot be renewed by a login redirect.
104
- */
101
+ /** Whether a host platform embedded this client in a frame. */
105
102
  embedded?: boolean;
106
103
  /**
107
- * Called whenever the identity changes: `true` when a token is set, `false`
108
- * on logout. Lets the client reach what holds its own copy of the identity —
109
- * the realtime socket, which carries a token on the handshake and so has to
110
- * open a new connection to pick one up, or drop the one it has.
104
+ * Called when the identity changes: `true` on `setToken`, `false` on
105
+ * `logout`. Lets the client redial the socket, which holds its own copy.
111
106
  */
112
107
  onSessionChange?: (hasSession: boolean) => void;
113
108
  }
@@ -192,13 +187,13 @@ export interface AuthModule {
192
187
  */
193
188
  redirectToLogin(nextUrl: string): void;
194
189
  /**
195
- * Whether the app is running embedded in a host platform.
190
+ * Whether a host platform embedded this app and signed its user in.
196
191
  *
197
- * A platform embeds an app in an iframe and signs its user in by minting a one-time token onto the frame's URL; the SDK trades it for a session as the client is created. That session is held in memory only and can be renewed only by the platform, so when it ends there is no login page to send the user to — {@linkcode AuthModule.redirectToLogin | redirectToLogin()} and {@linkcode AuthModule.logout | logout()} show a "session ended" notice instead. Use this to render your own notice or to hide sign-in and sign-out controls that cannot work inside the frame.
192
+ * Only the platform can renew that session, so {@linkcode AuthModule.redirectToLogin | redirectToLogin()} and {@linkcode AuthModule.logout | logout()} show a "session ended" notice rather than a login page. Use this to render your own notice, or to hide sign-in controls that cannot work in the frame.
198
193
  *
199
- * Because the session lives in memory, it does not survive a full page load inside the frame: routing within the app keeps it, while a reload or a real navigation ends it and the platform has to embed the app again — and this returns `false` on that load, since nothing about it says it was embedded. Prefer client-side navigation in an embedded app.
194
+ * The session lives in memory, so a reload inside the frame ends it and returns `false` here. Prefer client-side navigation.
200
195
  *
201
- * @returns `true` when the app was embedded by a host platform, `false` otherwise.
196
+ * @returns `true` when a host platform embedded this app.
202
197
  *
203
198
  * @example
204
199
  * ```typescript
@@ -569,9 +564,6 @@ export interface InternalAuthModule extends AuthModule {
569
564
  * could not succeed without a session, not to decide that one is valid.
570
565
  */
571
566
  hasToken(): boolean;
572
- /**
573
- * The access token currently set on the client, or `null` when there is none.
574
- * Follows {@linkcode AuthModule.setToken | setToken} and {@linkcode AuthModule.logout | logout}.
575
- */
567
+ /** The token currently set on the client, or `null`. */
576
568
  getToken(): string | null;
577
569
  }
@@ -40,6 +40,5 @@ export declare function createFetchWithAuth({ axios, serviceRoleAxios, appId, se
40
40
  serverUrl: string;
41
41
  functionsVersion?: string;
42
42
  platformHeaders?: Record<string, string>;
43
- /** Resolves once the client's session is settled. */
44
43
  waitForAuth?: () => Promise<void>;
45
44
  }): (path: string, init?: FetchWithAuthInit) => Promise<Response>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.8.48-pr.282.86ef42a",
3
+ "version": "0.8.48-pr.282.8a4c1c0",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",