@ikonai/sdk-react-ui 1.0.44 → 1.0.46

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.
@@ -66,8 +66,9 @@ export interface UseIkonAppOptions {
66
66
  */
67
67
  websocket?: boolean;
68
68
  /**
69
- * Force WebTransport transport only. When true, only WebTransport endpoint types are used.
70
- * When false, WebTransport types are excluded.
69
+ * Enable WebTransport. Off by default WebTransport has proven unreliable on
70
+ * bad networks. Set to `true` to opt in (also selectable at runtime with
71
+ * `?ikon-webtransport=true`). When unset or `false`, the SDK uses WebSocket only.
71
72
  */
72
73
  webtransport?: boolean;
73
74
  /**
@@ -13,18 +13,29 @@ export interface OAuthCallbackResult {
13
13
  */
14
14
  export declare function authenticateAnonymous(spaceId: string, authUrl: string): Promise<AuthSession>;
15
15
  /**
16
- * Options for sending a magic link email.
16
+ * Options for requesting a one-time login code via email.
17
17
  */
18
- export interface SendMagicLinkOptions {
18
+ export interface SendLoginCodeOptions {
19
19
  email: string;
20
20
  spaceId: string;
21
21
  authUrl: string;
22
- returnUrl?: string;
23
22
  }
24
23
  /**
25
- * Send a magic link email for passwordless authentication.
24
+ * Ask the auth service to email a one-time login code to the user.
26
25
  */
27
- export declare function sendMagicLink(options: SendMagicLinkOptions): Promise<void>;
26
+ export declare function sendLoginCode({ email, spaceId, authUrl }: SendLoginCodeOptions): Promise<void>;
27
+ /**
28
+ * Options for verifying a one-time login code.
29
+ */
30
+ export interface VerifyLoginCodeOptions {
31
+ email: string;
32
+ code: string;
33
+ authUrl: string;
34
+ }
35
+ /**
36
+ * Exchange a one-time login code for an authenticated session.
37
+ */
38
+ export declare function verifyLoginCode({ email, code, authUrl }: VerifyLoginCodeOptions): Promise<AuthSession>;
28
39
  /**
29
40
  * Parse OAuth callback parameters from the current URL.
30
41
  * Returns the token and provider if present, or null if not an OAuth callback.
package/auth/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export type { AuthConfig, AuthContextValue, AuthSession, AuthState, AuthUser, LoginMethod } from './types';
2
2
  export { clearAuthSession, loadAuthSession, saveAuthSession, sessionToUser } from './storage';
3
- export { authenticateAnonymous, buildOAuthRedirectUrl, clearOAuthParams, getPasskeyAuthenticationOptions, getPasskeyRegistrationOptions, isPasskeySupported, parseOAuthCallback, parseOAuthError, sendMagicLink, verifyPasskeyAuthentication, verifyPasskeyRegistration, type OAuthCallbackResult, type SendMagicLinkOptions, } from './auth-service';
3
+ export { authenticateAnonymous, buildOAuthRedirectUrl, clearOAuthParams, getPasskeyAuthenticationOptions, getPasskeyRegistrationOptions, isPasskeySupported, parseOAuthCallback, parseOAuthError, sendLoginCode, verifyLoginCode, verifyPasskeyAuthentication, verifyPasskeyRegistration, type OAuthCallbackResult, type SendLoginCodeOptions, type VerifyLoginCodeOptions, } from './auth-service';
4
4
  export { AuthProvider, useAuth, useAuthOptional, type AuthProviderProps } from './auth-context';
5
5
  export { useAuthGuard, type UseAuthGuardOptions, type UseAuthGuardResult } from './use-auth-guard';
package/auth/types.d.ts CHANGED
@@ -49,4 +49,6 @@ export interface AuthContextValue {
49
49
  logout: () => void;
50
50
  getToken: () => string | null;
51
51
  registerPasskey: (name?: string) => Promise<void>;
52
+ requestEmailCode: (email: string) => Promise<void>;
53
+ submitEmailCode: (email: string, code: string) => Promise<void>;
52
54
  }
package/index.d.ts CHANGED
@@ -11,7 +11,7 @@ export { UiRenderer, type UiRendererProps, UiComponentRegistry, createComponentL
11
11
  export type { UiComponentRenderer, UiComponentLibrary, UiNode, UiRenderContext, UiComponentRendererProps, ParsedUiUpdate, UiSnapshot, UiFullSnapshot, UiDiffSnapshot, UiNodeDiff, TextDelta, UiNodeProps, UiUpdateType, UiStoreSnapshot } from './renderer';
12
12
  export { UiStreamStore, type UiStylePayload } from '../../sdk-ui/src/index.ts';
13
13
  export { renderMotionLetters } from './shared/render-motion-letters';
14
- export { type AuthConfig, type AuthContextValue, type AuthSession, type AuthState, type AuthUser, type LoginMethod, clearAuthSession, loadAuthSession, saveAuthSession, sessionToUser, authenticateAnonymous, buildOAuthRedirectUrl, clearOAuthParams, parseOAuthCallback, parseOAuthError, sendMagicLink, type OAuthCallbackResult, type SendMagicLinkOptions, AuthProvider, useAuth, useAuthOptional, type AuthProviderProps, useAuthGuard, type UseAuthGuardOptions, type UseAuthGuardResult, } from './auth';
14
+ export { type AuthConfig, type AuthContextValue, type AuthSession, type AuthState, type AuthUser, type LoginMethod, clearAuthSession, loadAuthSession, saveAuthSession, sessionToUser, authenticateAnonymous, buildOAuthRedirectUrl, clearOAuthParams, parseOAuthCallback, parseOAuthError, sendLoginCode, verifyLoginCode, type OAuthCallbackResult, type SendLoginCodeOptions, type VerifyLoginCodeOptions, AuthProvider, useAuth, useAuthOptional, type AuthProviderProps, useAuthGuard, type UseAuthGuardOptions, type UseAuthGuardResult, } from './auth';
15
15
  export { ConnectionStateRenderer, type ConnectedRenderProps, type ConnectionStateRendererProps, useIkonApp, type IkonUiModuleRegistration, type UseIkonAppOptions, type UseIkonAppResult, } from './app';
16
16
  export { useLazyFont, useToasts, type Toast } from './hooks';
17
17
  export { I18nProvider, useI18n, type I18nContextValue, type I18nProviderProps } from './i18n';