@ikonai/sdk-react-ui 1.0.69 → 1.0.71

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.
@@ -12,6 +12,8 @@ declare global {
12
12
  spaceId: string;
13
13
  backendUrl?: string;
14
14
  authUrl?: string;
15
+ devLoginToken?: string;
16
+ devLoginRunId?: string;
15
17
  };
16
18
  __IKON_LOCAL_IKON_SERVER_CONFIG__?: {
17
19
  enabled: boolean;
@@ -83,9 +85,9 @@ export interface UseIkonAppOptions {
83
85
  */
84
86
  liveSnapshot?: boolean;
85
87
  /**
86
- * Boot snapshot: seed the build-time `boot-snapshot.json` (present when the app was bundled with
87
- * `--snapshot`) before the WebSocket connects, for instant first paint on a first visit. Default:
88
- * true. Set false to skip both the prefetch and the seed.
88
+ * Boot snapshot: seed the build-time `boot-snapshot.json` (present when the app enabled the
89
+ * `[BootSnapshot]` section in `ikon-config.toml`) before the WebSocket connects, for instant first
90
+ * paint on a first visit. Default: true. Set false to skip both the prefetch and the seed.
89
91
  */
90
92
  bootSnapshot?: boolean;
91
93
  }
package/auth/storage.d.ts CHANGED
@@ -1,4 +1,9 @@
1
1
  import { AuthSession, AuthUser } from './types';
2
+ /**
3
+ * Check whether a JWT token has expired by decoding its `exp` claim.
4
+ * Returns true when the token is expired or cannot be decoded.
5
+ */
6
+ export declare function isTokenExpired(token: string): boolean;
2
7
  /**
3
8
  * Save the authenticated user session to localStorage.
4
9
  */
@@ -12,6 +17,15 @@ export declare function loadAuthSession(): AuthSession | null;
12
17
  * Clear the authenticated user session from localStorage.
13
18
  */
14
19
  export declare function clearAuthSession(): void;
20
+ /**
21
+ * Mark dev auto-login as having been attempted for the given `ikon app run` id (stored in sessionStorage
22
+ * so it survives the logout's localStorage.clear() + reload). A no-op when no run id is available.
23
+ */
24
+ export declare function markAutoLoginAttempted(runId: string | undefined): void;
25
+ /**
26
+ * Read the run id for which dev auto-login was already attempted this tab, or null if none.
27
+ */
28
+ export declare function getAutoLoginAttemptedRunId(): string | null;
15
29
  /**
16
30
  * Convert AuthSession to AuthUser.
17
31
  */
package/auth/types.d.ts CHANGED
@@ -4,10 +4,13 @@
4
4
  export type LoginMethod = 'google' | 'facebook' | 'apple' | 'microsoft' | 'signicat' | 'linkedin' | 'github' | 'email' | 'passkey' | 'guest';
5
5
  /**
6
6
  * Authenticated user information.
7
+ *
8
+ * `provider` covers the interactive login methods plus 'anonymous' (guest backend session) and 'dev'
9
+ * (local `ikon app run` developer auto-login).
7
10
  */
8
11
  export interface AuthUser {
9
12
  id: string;
10
- provider: LoginMethod | 'anonymous';
13
+ provider: LoginMethod | 'anonymous' | 'dev';
11
14
  token: string;
12
15
  authenticatedAt: number;
13
16
  }
@@ -31,13 +34,23 @@ export interface AuthConfig {
31
34
  backendUrl?: string;
32
35
  /** Optional custom auth URL. If not provided, derived from environment. */
33
36
  authUrl?: string;
37
+ /**
38
+ * Developer JWT injected by a local `ikon app run` to auto-login as the `ikon login` developer.
39
+ * Local dev only — never set in deployed builds.
40
+ */
41
+ devLoginToken?: string;
42
+ /**
43
+ * Unique id for the current `ikon app run`. Auto-login is suppressed once the user logs out within a
44
+ * run, but a new run mints a new id and re-enables it. Paired with {@link devLoginToken}.
45
+ */
46
+ devLoginRunId?: string;
34
47
  }
35
48
  /**
36
49
  * Stored session data in localStorage.
37
50
  */
38
51
  export interface AuthSession {
39
52
  token: string;
40
- provider: LoginMethod | 'anonymous';
53
+ provider: LoginMethod | 'anonymous' | 'dev';
41
54
  authenticatedAt: number;
42
55
  }
43
56
  /**
package/index.d.ts CHANGED
@@ -4,7 +4,6 @@ export { IkonUiSurface, IKON_UI_STREAM_CATEGORY, isIkonUiCategoryMatch, type Iko
4
4
  export { ParallaxView, type ParallaxViewProps } from './parallax-view';
5
5
  export { useIkonStyles, type IkonUiStyleSource } from './use-ikon-styles';
6
6
  export { useIkonUiStores } from './use-ikon-ui-stores';
7
- export { parseIkonUiInitPayload, normalizeIkonUiModuleList, readIkonUiModules, readIkonUiModulesFromSources, areIkonUiModuleListsEqual, type IkonUiInitInstruction, type IkonUiInitModulePayload, type IkonUiModuleList } from './modules';
8
7
  export { IKON_UI_BASE_MODULE, createBaseResolvers, loadBaseModule, registerBaseModule } from './base/base-module';
9
8
  export { IKON_UI_MEDIA_MODULE, IKON_UI_VIDEO_CANVAS_TYPE, IKON_UI_VIDEO_URL_PLAYER_TYPE, createMediaResolvers, loadMediaModule, registerMediaModule } from './media/media-module';
10
9
  export { IKON_UI_SHADERTOY_MODULE, IKON_UI_SHADERTOY_TYPE, createShadertoyRendererResolver, loadShadertoyModule, registerShadertoyModule } from './shadertoy/shadertoy-module';