@sparkvault/sdk-js 8.0.1 → 8.1.1
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.ts +22 -29
- package/dist/products/identity/dialog-launcher.d.ts +74 -0
- package/dist/products/identity/handlers/passkey-handler.d.ts +3 -8
- package/dist/products/identity/index.d.ts +9 -10
- package/dist/products/identity/inline-container.d.ts +5 -0
- package/dist/products/identity/popup-launcher.d.ts +60 -0
- package/dist/products/identity/styles.d.ts +10 -1
- package/dist/products/identity/types.d.ts +13 -26
- package/dist/sparkvault.cjs.js +622 -446
- package/dist/sparkvault.cjs.js.map +1 -1
- package/dist/sparkvault.esm.js +622 -446
- package/dist/sparkvault.esm.js.map +1 -1
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/package.json +1 -1
- package/dist/products/identity/embedder.d.ts +0 -83
package/package.json
CHANGED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Widget Embedder
|
|
3
|
-
*
|
|
4
|
-
* Host-side half of the iframe architecture. For dialog (modal) verification,
|
|
5
|
-
* the SDK injects a borderless, transparent, full-viewport iframe pointing at
|
|
6
|
-
* the SparkVault-hosted widget page and bridges the result back over
|
|
7
|
-
* postMessage. Running the flow on the SparkVault origin lets passkey login
|
|
8
|
-
* complete in a single tap on every platform — the WebAuthn ceremony is
|
|
9
|
-
* same-origin with the RP id and the user's tap lives in the iframe document —
|
|
10
|
-
* without a popup.
|
|
11
|
-
*
|
|
12
|
-
* The widget renders the SDK's own modal (overlay, backdrop, chrome) inside the
|
|
13
|
-
* iframe, so the page sees only a transparent full-viewport frame: no border,
|
|
14
|
-
* no seam, visually identical to the in-page modal.
|
|
15
|
-
*/
|
|
16
|
-
import type { ResolvedConfig } from '../../config';
|
|
17
|
-
import type { VerifyOptions, VerifyResult } from './types';
|
|
18
|
-
interface EmbedderCallbacks {
|
|
19
|
-
onSuccess: (result: VerifyResult) => void;
|
|
20
|
-
onError: (error: Error) => void;
|
|
21
|
-
onCancel: () => void;
|
|
22
|
-
/**
|
|
23
|
-
* The hosted widget frame never became interactive (blocked from framing,
|
|
24
|
-
* failed to load, or its in-frame SDK never mounted). The host should recover
|
|
25
|
-
* by running the flow in-page so login still works and the scroll lock is
|
|
26
|
-
* released.
|
|
27
|
-
*/
|
|
28
|
-
onFrameUnavailable: () => void;
|
|
29
|
-
}
|
|
30
|
-
export declare class WidgetEmbedder {
|
|
31
|
-
private readonly config;
|
|
32
|
-
private readonly options;
|
|
33
|
-
private readonly callbacks;
|
|
34
|
-
private iframe;
|
|
35
|
-
private settled;
|
|
36
|
-
private ready;
|
|
37
|
-
private failed;
|
|
38
|
-
private readyTimer;
|
|
39
|
-
private previousBodyOverflow;
|
|
40
|
-
private readonly trustedOrigin;
|
|
41
|
-
private readonly boundHandleMessage;
|
|
42
|
-
private readonly boundHandleCspViolation;
|
|
43
|
-
constructor(config: ResolvedConfig, options: VerifyOptions, callbacks: EmbedderCallbacks);
|
|
44
|
-
start(): void;
|
|
45
|
-
/**
|
|
46
|
-
* Nudge the browser to paint the just-inserted iframe on the next frame.
|
|
47
|
-
* Reading layout forces a reflow; toggling a transform forces the compositor
|
|
48
|
-
* to flush the new layer — the workaround for iOS Safari leaving a fixed
|
|
49
|
-
* full-viewport iframe invisible until an unrelated repaint.
|
|
50
|
-
*/
|
|
51
|
-
private forceComposite;
|
|
52
|
-
close(): void;
|
|
53
|
-
/**
|
|
54
|
-
* Host CSP blocked the widget iframe (frame-src/child-src). The frame can
|
|
55
|
-
* never load, so fail over to the in-page flow immediately.
|
|
56
|
-
*/
|
|
57
|
-
private handleCspViolation;
|
|
58
|
-
private clearReadyTimer;
|
|
59
|
-
/**
|
|
60
|
-
* The widget frame never became interactive. Tear down, release the host
|
|
61
|
-
* scroll lock, and hand control back so the flow can run in-page. Guarded so
|
|
62
|
-
* a late onerror or timeout firing after a real result (or after the frame
|
|
63
|
-
* has proven itself with `ready`) is a no-op.
|
|
64
|
-
*/
|
|
65
|
-
private handleFrameUnavailable;
|
|
66
|
-
/**
|
|
67
|
-
* Begin a social-login redirect from the host. State and redirect_uri are
|
|
68
|
-
* the customer's top origin so `consumeRedirectResult` validates them on
|
|
69
|
-
* return. Mirrors the SDK's getSocialAuthUrl.
|
|
70
|
-
*/
|
|
71
|
-
private startSocial;
|
|
72
|
-
/**
|
|
73
|
-
* Navigate the host top window to a widget-supplied URL — only when it
|
|
74
|
-
* resolves to http(s). The sender is already constrained to the trusted
|
|
75
|
-
* widget origin, but defense-in-depth across the SparkVault->customer
|
|
76
|
-
* boundary: compromised widget-origin code must never escalate into script
|
|
77
|
-
* execution on the embedding page via a javascript:/data: navigation.
|
|
78
|
-
*/
|
|
79
|
-
private safeNavigate;
|
|
80
|
-
private buildUrl;
|
|
81
|
-
private handleMessage;
|
|
82
|
-
}
|
|
83
|
-
export {};
|