@ikonai/sdk 1.0.58 → 1.0.60

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikonai/sdk",
3
- "version": "1.0.58",
3
+ "version": "1.0.60",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
package/storage.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  */
4
4
  /**
5
5
  * Get or create a persistent device ID.
6
- * Uses crypto.randomUUID() and stores in localStorage for persistence across sessions.
6
+ * Uses randomUuid() and stores in localStorage for persistence across sessions.
7
7
  * Falls back to generating a new UUID if localStorage is unavailable.
8
8
  */
9
9
  export declare function getOrCreateDeviceId(): string;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `AbortSignal.timeout()` / `AbortSignal.any()` with fallbacks for older browsers.
3
+ *
4
+ * `AbortSignal.timeout()` only shipped in Chromium 103 and `AbortSignal.any()` in Chromium 116,
5
+ * so both are missing on older smart-TV browsers (e.g. Samsung Tizen Chromium 76/85). They sit on
6
+ * the connection path (fetch timeouts), where calling them throws
7
+ * `AbortSignal.timeout is not a function` and silently aborts the connect, hanging the app on
8
+ * "Connecting…" / showing it offline.
9
+ *
10
+ * `AbortController` (Chromium 66) is available far more widely, so we rebuild the same behaviour
11
+ * from it when the static helpers are absent.
12
+ */
13
+ /**
14
+ * Returns an `AbortSignal` that aborts after `ms` milliseconds.
15
+ */
16
+ export declare function abortSignalTimeout(ms: number): AbortSignal;
17
+ /**
18
+ * Returns an `AbortSignal` that aborts as soon as any of `signals` aborts.
19
+ */
20
+ export declare function abortSignalAny(signals: AbortSignal[]): AbortSignal;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Runtime feature detection for the SDK's hard requirements.
3
+ *
4
+ * These are the features the SDK genuinely cannot run without: the transport needs `WebSocket`,
5
+ * the connect path needs `fetch`, the Teleport protocol codec needs `BigInt` for every 64-bit
6
+ * field, and core code references `globalThis` and `Promise.allSettled`. All of them shipped by
7
+ * Chromium 76 / Firefox 71 / Safari 13 (2019), so a missing one means a genuinely outdated browser
8
+ * (e.g. a legacy smart-TV) — this never trips on a current browser.
9
+ *
10
+ * It deliberately does NOT check features the SDK already feature-detects and falls back for
11
+ * (`crypto.randomUUID`, `AbortSignal.timeout`), gates server-side (`DecompressionStream` via
12
+ * `SupportsCompression`), or loads lazily (`WebAssembly`, only when audio starts).
13
+ *
14
+ * NOTE: `BigInt` here is mostly belt-and-suspenders — the protocol modules use BigInt *literals*
15
+ * (`0n`), which are parse-time syntax, so a BigInt-less browser fails to parse the bundle before
16
+ * this check ever runs. The bundle's HTML bootstrap performs the same check pre-import to cover
17
+ * that case; keep the two feature lists in sync.
18
+ */
19
+ export interface BrowserSupportResult {
20
+ readonly supported: boolean;
21
+ readonly missingFeatures: string[];
22
+ }
23
+ /**
24
+ * Check whether the current runtime has every feature the SDK requires.
25
+ */
26
+ export declare function checkBrowserSupport(): BrowserSupportResult;
@@ -33,6 +33,8 @@ export declare const IKON_PARAM_AUDIO = "ikon-audio";
33
33
  export declare const IKON_PARAM_VIDEO = "ikon-video";
34
34
  export declare const IKON_PARAM_WEBRTC = "ikon-webrtc";
35
35
  export declare const IKON_PARAM_INSPECT = "ikon-inspect";
36
+ export declare const IKON_PARAM_DEBUG_OVERLAY = "ikon-debug-overlay";
37
+ export declare const IKON_PARAM_AUTH = "ikon-auth";
36
38
  export declare const IKON_PARAM_RETRY = "ikon-retry";
37
39
  export declare const IKON_PARAM_API = "ikon-api";
38
40
  /**
@@ -49,5 +51,19 @@ export declare function getAudioParam(): boolean | null;
49
51
  export declare function getVideoParam(): boolean | null;
50
52
  export declare function getWebRtcParam(): boolean | null;
51
53
  export declare function getInspectParam(): boolean;
54
+ /**
55
+ * On-screen debug overlay toggle. Distinct from `ikon-debug` (verbose logging / devtools):
56
+ * debug mode does NOT force the visual overlay, since you usually want a console, not a panel
57
+ * over the UI. Enable explicitly with `?ikon-debug-overlay=true`.
58
+ */
59
+ export declare function getDebugOverlayParam(): boolean;
60
+ /**
61
+ * Route auth (anonymous / OAuth / email / passkey) through the app's own origin at /ikon/auth
62
+ * instead of the cross-origin auth host. Opt-in (`?ikon-auth=same` or `=true`) until the app LB
63
+ * exposes the `/ikon/auth/*` → auth-backend route. Once that route is live this can become the
64
+ * default (mirroring how `ikon-api` defaults to same-origin) — which also fixes old devices
65
+ * (e.g. smart-TV browsers) that don't trust the standalone auth host's TLS certificate.
66
+ */
67
+ export declare function getAuthSameOriginParam(): boolean;
52
68
  export declare function getRetryParam(): boolean;
53
69
  export declare function getApiParam(): boolean | null;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `crypto.randomUUID()` with a fallback for older browsers.
3
+ *
4
+ * `crypto.randomUUID()` only shipped in Chromium 92 / Safari 15.4 and requires a secure
5
+ * context, so it is missing on older smart-TV browsers (e.g. Samsung Tizen Chromium 85).
6
+ * Calling it there throws `crypto.randomUUID is not a function`, which on the connection path
7
+ * (anonymous device id) silently aborts the connect and hangs the app on "Connecting…".
8
+ *
9
+ * Falls back to a UUID v4 built from `crypto.getRandomValues` (supported far more widely), then
10
+ * to `Math.random` as a last resort.
11
+ */
12
+ export declare function randomUuid(): string;