@ikonai/sdk 1.0.5 → 1.0.6

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.
@@ -2,7 +2,7 @@
2
2
  * Connection state managed by IkonClient.
3
3
  * The SDK internally manages UI-related states with timers.
4
4
  */
5
- export type ConnectionState = 'idle' | 'connecting' | 'connectingSlow' | 'connected' | 'reconnecting' | 'offline' | 'offlineError';
5
+ export type ConnectionState = 'idle' | 'waitingForToken' | 'connecting' | 'connectingSlow' | 'connected' | 'reconnecting' | 'offline' | 'offlineError';
6
6
  /**
7
7
  * Check if the state indicates the client is actively trying to connect.
8
8
  */
@@ -109,6 +109,8 @@ export declare class IkonClient {
109
109
  private nextProtocolSendPortId;
110
110
  private readonly _media;
111
111
  private _mediaCapture;
112
+ private _externalTokenMode;
113
+ private _externalTokenCleanup;
112
114
  /**
113
115
  * SDK-provided media pipelines (audio/video).
114
116
  *
@@ -153,6 +155,10 @@ export declare class IkonClient {
153
155
  * Returns when connected or throws if connection fails.
154
156
  */
155
157
  connect(): Promise<void>;
158
+ /**
159
+ * Execute the connection flow with the provided authentication function.
160
+ */
161
+ private executeConnection;
156
162
  /**
157
163
  * Disconnect from the server.
158
164
  */
@@ -272,4 +278,13 @@ export declare class IkonClient {
272
278
  * Called on every connect (including reconnects).
273
279
  */
274
280
  private handleJoined;
281
+ /**
282
+ * Set up listener for external token from parent window.
283
+ * Returns cleanup function to remove the listener.
284
+ */
285
+ private setupExternalTokenListener;
286
+ /**
287
+ * Handle external token injection from parent window.
288
+ */
289
+ private handleExternalToken;
275
290
  }
@@ -6,6 +6,10 @@ import { ApiKeyConfig, LocalConfig, SessionTokenConfig } from '../client/ikon-cl
6
6
  export interface AuthResult {
7
7
  authResponse: AuthResponse;
8
8
  }
9
+ /**
10
+ * Common authentication logic - fetch the connect URL and decode the AuthResponse.
11
+ */
12
+ export declare function authenticateWithUrl(connectUrl: string, signal?: AbortSignal): Promise<AuthResult>;
9
13
  /**
10
14
  * Authenticate with a local Ikon server in development mode.
11
15
  *