@swype-org/react-sdk 0.1.87 → 0.1.89

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/dist/index.d.cts CHANGED
@@ -391,19 +391,16 @@ interface SwypePaymentProps {
391
391
  declare function SwypePayment(props: SwypePaymentProps): react_jsx_runtime.JSX.Element;
392
392
 
393
393
  /**
394
- * Cross-origin iframe passkey delegation via postMessage.
394
+ * Cross-origin iframe passkey helpers.
395
395
  *
396
396
  * When the webview-app runs inside a cross-origin iframe, WebAuthn
397
397
  * ceremonies cannot execute from within the iframe on Safari. For passkey
398
398
  * creation, we first attempt a direct `navigator.credentials.create()`
399
399
  * call (works in Chrome/Firefox with the iframe permissions policy). If
400
400
  * that fails (Safari), we open a same-origin pop-up window on the Swype
401
- * domain to perform the ceremony, then relay the result back via
402
- * `BroadcastChannel` (Safari strips `window.opener` from popups opened
403
- * by cross-origin iframes, so `postMessage` via opener doesn't work).
404
- *
405
- * Passkey *assertion* (`navigator.credentials.get`) still delegates to
406
- * the parent page via postMessage as before.
401
+ * domain to perform the ceremony. The popup writes the result to the
402
+ * server with a verification token, and the opener reads from the server
403
+ * after the popup closes.
407
404
  */
408
405
  /**
409
406
  * Thrown when `navigator.credentials.create()` fails inside a
@@ -431,7 +428,7 @@ interface PasskeyPopupOptions {
431
428
  };
432
429
  timeout?: number;
433
430
  /** Populated by `createPasskeyViaPopup`; not set by callers. */
434
- channelId?: string;
431
+ verificationToken?: string;
435
432
  /** Privy JWT so the popup can register the passkey server-side. */
436
433
  authToken?: string;
437
434
  /** Core API base URL for server-side passkey registration. */
@@ -442,24 +439,14 @@ interface PasskeyPopupOptions {
442
439
  * passkey creation. Used as a fallback when Safari blocks
443
440
  * `navigator.credentials.create()` inside a cross-origin iframe.
444
441
  *
445
- * Communication uses `BroadcastChannel` because Safari strips
446
- * `window.opener` from popups opened by cross-origin iframes.
447
- * Falls back to `window.postMessage` for browsers that preserve the
448
- * opener reference.
449
- *
450
- * When both client-side channels are blocked (Safari ITP partitions
451
- * BroadcastChannel by top-level origin), the popup registers the
452
- * passkey directly with the backend. On popup close, this function
453
- * checks the server for newly registered passkeys as a final fallback.
442
+ * The popup registers the passkey with the server using a verification
443
+ * token. After the popup closes, this function checks the server for
444
+ * the passkey matching the token.
454
445
  *
455
446
  * Must be called from a user-gesture handler (e.g. button click) to
456
447
  * avoid the browser's pop-up blocker.
457
- *
458
- * @param existingCredentialIds - Credential IDs known before the popup
459
- * opens. Used to diff against server state when the popup closes
460
- * without delivering a client-side result.
461
448
  */
462
- declare function createPasskeyViaPopup(options: PasskeyPopupOptions, existingCredentialIds?: string[]): Promise<{
449
+ declare function createPasskeyViaPopup(options: PasskeyPopupOptions): Promise<{
463
450
  credentialId: string;
464
451
  publicKey: string;
465
452
  }>;
@@ -467,8 +454,6 @@ interface PasskeyVerifyPopupOptions {
467
454
  credentialIds: string[];
468
455
  rpId: string;
469
456
  /** Populated by `findDevicePasskeyViaPopup`; not set by callers. */
470
- channelId?: string;
471
- /** Populated by `findDevicePasskeyViaPopup`; not set by callers. */
472
457
  verificationToken?: string;
473
458
  /** Privy JWT so the popup can report verification server-side. */
474
459
  authToken?: string;
@@ -483,10 +468,9 @@ interface PasskeyVerifyPopupOptions {
483
468
  * inside a cross-origin iframe. The popup runs on the Swype domain where
484
469
  * the rpId matches, so WebAuthn works.
485
470
  *
486
- * When `authToken` and `apiBaseUrl` are provided, the popup also writes a
487
- * verification token to the backend. If Safari's ITP blocks both
488
- * BroadcastChannel and window.opener.postMessage, the opener falls back to
489
- * checking the server for the matching token after the popup closes.
471
+ * The popup writes a verification token to the server. After the popup
472
+ * closes, the opener checks the server for the matching token to determine
473
+ * which credential was verified.
490
474
  *
491
475
  * Must be called from a user-gesture handler (e.g. button click) to
492
476
  * avoid the browser's pop-up blocker.
package/dist/index.d.ts CHANGED
@@ -391,19 +391,16 @@ interface SwypePaymentProps {
391
391
  declare function SwypePayment(props: SwypePaymentProps): react_jsx_runtime.JSX.Element;
392
392
 
393
393
  /**
394
- * Cross-origin iframe passkey delegation via postMessage.
394
+ * Cross-origin iframe passkey helpers.
395
395
  *
396
396
  * When the webview-app runs inside a cross-origin iframe, WebAuthn
397
397
  * ceremonies cannot execute from within the iframe on Safari. For passkey
398
398
  * creation, we first attempt a direct `navigator.credentials.create()`
399
399
  * call (works in Chrome/Firefox with the iframe permissions policy). If
400
400
  * that fails (Safari), we open a same-origin pop-up window on the Swype
401
- * domain to perform the ceremony, then relay the result back via
402
- * `BroadcastChannel` (Safari strips `window.opener` from popups opened
403
- * by cross-origin iframes, so `postMessage` via opener doesn't work).
404
- *
405
- * Passkey *assertion* (`navigator.credentials.get`) still delegates to
406
- * the parent page via postMessage as before.
401
+ * domain to perform the ceremony. The popup writes the result to the
402
+ * server with a verification token, and the opener reads from the server
403
+ * after the popup closes.
407
404
  */
408
405
  /**
409
406
  * Thrown when `navigator.credentials.create()` fails inside a
@@ -431,7 +428,7 @@ interface PasskeyPopupOptions {
431
428
  };
432
429
  timeout?: number;
433
430
  /** Populated by `createPasskeyViaPopup`; not set by callers. */
434
- channelId?: string;
431
+ verificationToken?: string;
435
432
  /** Privy JWT so the popup can register the passkey server-side. */
436
433
  authToken?: string;
437
434
  /** Core API base URL for server-side passkey registration. */
@@ -442,24 +439,14 @@ interface PasskeyPopupOptions {
442
439
  * passkey creation. Used as a fallback when Safari blocks
443
440
  * `navigator.credentials.create()` inside a cross-origin iframe.
444
441
  *
445
- * Communication uses `BroadcastChannel` because Safari strips
446
- * `window.opener` from popups opened by cross-origin iframes.
447
- * Falls back to `window.postMessage` for browsers that preserve the
448
- * opener reference.
449
- *
450
- * When both client-side channels are blocked (Safari ITP partitions
451
- * BroadcastChannel by top-level origin), the popup registers the
452
- * passkey directly with the backend. On popup close, this function
453
- * checks the server for newly registered passkeys as a final fallback.
442
+ * The popup registers the passkey with the server using a verification
443
+ * token. After the popup closes, this function checks the server for
444
+ * the passkey matching the token.
454
445
  *
455
446
  * Must be called from a user-gesture handler (e.g. button click) to
456
447
  * avoid the browser's pop-up blocker.
457
- *
458
- * @param existingCredentialIds - Credential IDs known before the popup
459
- * opens. Used to diff against server state when the popup closes
460
- * without delivering a client-side result.
461
448
  */
462
- declare function createPasskeyViaPopup(options: PasskeyPopupOptions, existingCredentialIds?: string[]): Promise<{
449
+ declare function createPasskeyViaPopup(options: PasskeyPopupOptions): Promise<{
463
450
  credentialId: string;
464
451
  publicKey: string;
465
452
  }>;
@@ -467,8 +454,6 @@ interface PasskeyVerifyPopupOptions {
467
454
  credentialIds: string[];
468
455
  rpId: string;
469
456
  /** Populated by `findDevicePasskeyViaPopup`; not set by callers. */
470
- channelId?: string;
471
- /** Populated by `findDevicePasskeyViaPopup`; not set by callers. */
472
457
  verificationToken?: string;
473
458
  /** Privy JWT so the popup can report verification server-side. */
474
459
  authToken?: string;
@@ -483,10 +468,9 @@ interface PasskeyVerifyPopupOptions {
483
468
  * inside a cross-origin iframe. The popup runs on the Swype domain where
484
469
  * the rpId matches, so WebAuthn works.
485
470
  *
486
- * When `authToken` and `apiBaseUrl` are provided, the popup also writes a
487
- * verification token to the backend. If Safari's ITP blocks both
488
- * BroadcastChannel and window.opener.postMessage, the opener falls back to
489
- * checking the server for the matching token after the popup closes.
471
+ * The popup writes a verification token to the server. After the popup
472
+ * closes, the opener checks the server for the matching token to determine
473
+ * which credential was verified.
490
474
  *
491
475
  * Must be called from a user-gesture handler (e.g. button click) to
492
476
  * avoid the browser's pop-up blocker.