@ikonai/sdk 1.3.7 → 1.3.9

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.3.7",
3
+ "version": "1.3.9",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -3,9 +3,13 @@
3
3
  *
4
4
  * A framed app cannot sign in the way an unframed one does. The provider's consent screen sets
5
5
  * X-Frame-Options and refuses to paint in a frame, and the frame's own address — a Studio preview
6
- * gets a relay host and port per session — can never be an allowed return target. So the redirect
7
- * runs in a popup, returns to the auth service's own origin (always allowed), and that landing
8
- * hands the authorization code back here by postMessage.
6
+ * gets a relay host and port per session — can never be an allowed return target.
7
+ *
8
+ * So the embedder is asked to run it: it owns a top-level window whose address IS an allowed
9
+ * target. It answers with the result, which this frame collects by message — see
10
+ * {@link onEmbeddedOAuthResult}. An embedder that does not answer leaves the popup below, which
11
+ * lands on the auth service's own origin and posts the code back; that is the only route for a host
12
+ * this app is merely iframed into.
9
13
  *
10
14
  * Both sign-in entry points route through here: the React auth context and the server-drawn
11
15
  * `ikon.client.login` client function. They used to build the same redirect URL separately, and
@@ -11,7 +11,10 @@
11
11
  * - ikon-webtransport Force WebTransport on (true); default is off. `false` is accepted for parity.
12
12
  * - ikon-debug Enable SDK debug logging (true)
13
13
  * - ikon-lang Override language detection (e.g., "en", "fi")
14
- * - ikon-server-url External connect URL for shareable preview links
14
+ * - ikon-server-url External connect URL for shareable preview links (full URL form)
15
+ * - ikon-connect Compact form of the same thing: the connect token, optionally prefixed with
16
+ * "<port>~" when the Ikon server is on a different port of the SAME host as the
17
+ * page. Carries a credential — treat it like ikon-server-url
15
18
  * - ikon-audio Force audio on (true) or off (false)
16
19
  * - ikon-video Force video on (true) or off (false)
17
20
  * - ikon-webrtc Force WebRTC on (true) or off (false)
@@ -28,6 +31,7 @@ export declare const IKON_PARAM_WEBTRANSPORT = "ikon-webtransport";
28
31
  export declare const IKON_PARAM_DEBUG = "ikon-debug";
29
32
  export declare const IKON_PARAM_LANG = "ikon-lang";
30
33
  export declare const IKON_PARAM_SERVER_URL = "ikon-server-url";
34
+ export declare const IKON_PARAM_CONNECT = "ikon-connect";
31
35
  export declare const IKON_PARAM_AUDIO = "ikon-audio";
32
36
  export declare const IKON_PARAM_VIDEO = "ikon-video";
33
37
  export declare const IKON_PARAM_WEBRTC = "ikon-webrtc";
@@ -49,6 +53,17 @@ export declare function getWebTransportParam(): boolean | null;
49
53
  export declare function getDebugParam(): boolean;
50
54
  export declare function getLangParam(): string | null;
51
55
  export declare function getServerUrlParam(): string | null;
56
+ /**
57
+ * The compact external connect parameter, resolved against the page's own origin.
58
+ *
59
+ * A preview's frontend is usually served by the Ikon server itself, so the link needs to carry only
60
+ * the token; when the frontend is on its own port of the same host it carries "<port>~" as well.
61
+ * Anything else — a genuinely different host — keeps using {@link IKON_PARAM_SERVER_URL}, because
62
+ * only a full URL can express it.
63
+ *
64
+ * Returns null when the parameter is absent, so a caller can fall back.
65
+ */
66
+ export declare function getConnectParam(): string | null;
52
67
  export declare function getAudioParam(): boolean | null;
53
68
  export declare function getVideoParam(): boolean | null;
54
69
  export declare function getWebRtcParam(): boolean | null;