@ikonai/sdk 1.3.1 → 1.3.2

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.1",
3
+ "version": "1.3.2",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -0,0 +1,30 @@
1
+ /**
2
+ * OAuth sign-in for an app running inside someone else's page.
3
+ *
4
+ * A framed app cannot sign in the way an unframed one does. The provider's consent screen sets
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.
9
+ *
10
+ * Both sign-in entry points route through here: the React auth context and the server-drawn
11
+ * `ikon.client.login` client function. They used to build the same redirect URL separately, and
12
+ * keeping two copies in step is exactly what failed once already.
13
+ */
14
+ /**
15
+ * True when this document is nested in another. A cross-origin parent makes the property access
16
+ * itself throw, which is the embedded case too.
17
+ */
18
+ export declare function isEmbedded(): boolean;
19
+ /**
20
+ * Sign in through a popup and land the result on this page's URL.
21
+ *
22
+ * The code is handed over by reloading this document with `ikon_code` on it rather than by redeeming
23
+ * it here: that is the exact shape the unframed redirect flow already produces, so the callback
24
+ * consumer that reads it needs no second code path and no knowledge of how the code arrived. The
25
+ * reload is same-origin, so nothing frames anything it may not.
26
+ *
27
+ * Returns false when the popup could not be opened or the sign-in did not complete; the caller
28
+ * reports that to the person. Throws nothing — a failed sign-in is an outcome, not an exception.
29
+ */
30
+ export declare function startEmbeddedOAuthSignIn(provider: string, spaceId: string): Promise<boolean>;