@sparkvault/sdk-js 19.0.0 → 19.1.0
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/README.md +26 -4
- package/dist/npm/chunks/index-BnP-2w0t.cjs +13025 -0
- package/dist/npm/chunks/index-BnP-2w0t.cjs.map +1 -0
- package/dist/npm/chunks/index-CgR08uMG.mjs +12960 -0
- package/dist/npm/chunks/index-CgR08uMG.mjs.map +1 -0
- package/dist/npm/identity.cjs +23 -0
- package/dist/npm/identity.cjs.map +1 -0
- package/dist/npm/identity.mjs +12 -0
- package/dist/npm/identity.mjs.map +1 -0
- package/dist/{index.cjs → npm/index.cjs} +799 -13755
- package/dist/npm/index.cjs.map +1 -0
- package/dist/{index.mjs → npm/index.mjs} +200 -13155
- package/dist/npm/index.mjs.map +1 -0
- package/dist/sparkvault-identity.js +2 -0
- package/dist/sparkvault-identity.js.map +1 -0
- package/dist/sparkvault.js +1 -1
- package/dist/types/identity.d.ts +8 -0
- package/dist/{index.d.ts → types/index.d.ts} +4 -790
- package/dist/types/shared/errors-C-gjmGBs.d.ts +800 -0
- package/package.json +20 -9
- package/dist/api-base.d.ts +0 -116
- package/dist/auto-init.d.ts +0 -32
- package/dist/config.d.ts +0 -79
- package/dist/entropy/index.d.ts +0 -35
- package/dist/entropy/types.d.ts +0 -32
- package/dist/errors.d.ts +0 -146
- package/dist/folders/index.d.ts +0 -102
- package/dist/folders/types.d.ts +0 -91
- package/dist/health.d.ts +0 -18
- package/dist/http.d.ts +0 -46
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/ingots/fetch-download.d.ts +0 -78
- package/dist/ingots/history.d.ts +0 -4
- package/dist/ingots/index.d.ts +0 -388
- package/dist/ingots/revision.d.ts +0 -4
- package/dist/ingots/types.d.ts +0 -556
- package/dist/logger.d.ts +0 -32
- package/dist/notify/index.d.ts +0 -154
- package/dist/notify/types.d.ts +0 -232
- package/dist/products/help-desk/client.d.ts +0 -198
- package/dist/products/help-desk/desk-id.d.ts +0 -2
- package/dist/products/help-desk/form-draft.d.ts +0 -37
- package/dist/products/help-desk/form-types.d.ts +0 -123
- package/dist/products/help-desk/form.d.ts +0 -83
- package/dist/products/help-desk/index.d.ts +0 -47
- package/dist/products/help-desk/kb-client.d.ts +0 -48
- package/dist/products/help-desk/kb-types.d.ts +0 -59
- package/dist/products/help-desk/modal.d.ts +0 -8
- package/dist/products/help-desk/styles.d.ts +0 -9
- package/dist/products/help-desk/support-analytics-types.d.ts +0 -32
- package/dist/products/help-desk/support-analytics.d.ts +0 -3
- package/dist/products/help-desk/support-brand.d.ts +0 -49
- package/dist/products/help-desk/support-controller.d.ts +0 -4
- package/dist/products/help-desk/support-history.d.ts +0 -38
- package/dist/products/help-desk/support-launcher.d.ts +0 -12
- package/dist/products/help-desk/support-styles.d.ts +0 -14
- package/dist/products/help-desk/support-types.d.ts +0 -66
- package/dist/products/help-desk/support-view.d.ts +0 -173
- package/dist/products/help-desk/types.d.ts +0 -285
- package/dist/products/help-desk/widget-identity.d.ts +0 -32
- package/dist/products/identity/api.d.ts +0 -237
- package/dist/products/identity/container.d.ts +0 -44
- package/dist/products/identity/dialog-launcher.d.ts +0 -133
- package/dist/products/identity/federation-flow.d.ts +0 -31
- package/dist/products/identity/handlers/otp-handler.d.ts +0 -69
- package/dist/products/identity/handlers/passkey-handler.d.ts +0 -105
- package/dist/products/identity/handlers/sparklink-handler.d.ts +0 -34
- package/dist/products/identity/index.d.ts +0 -296
- package/dist/products/identity/inline-container.d.ts +0 -53
- package/dist/products/identity/methods.d.ts +0 -19
- package/dist/products/identity/modal.d.ts +0 -51
- package/dist/products/identity/pending-signin.d.ts +0 -102
- package/dist/products/identity/popup-launcher.d.ts +0 -73
- package/dist/products/identity/renderer.d.ts +0 -525
- package/dist/products/identity/state.d.ts +0 -84
- package/dist/products/identity/styles.d.ts +0 -31
- package/dist/products/identity/types.d.ts +0 -561
- package/dist/products/identity/utils/cooldown-timer.d.ts +0 -73
- package/dist/products/identity/utils.d.ts +0 -85
- package/dist/products/identity/views/backup-verify.d.ts +0 -42
- package/dist/products/identity/views/base.d.ts +0 -51
- package/dist/products/identity/views/error.d.ts +0 -65
- package/dist/products/identity/views/icons.d.ts +0 -41
- package/dist/products/identity/views/identity-input.d.ts +0 -80
- package/dist/products/identity/views/index.d.ts +0 -20
- package/dist/products/identity/views/loading.d.ts +0 -23
- package/dist/products/identity/views/method-button.d.ts +0 -14
- package/dist/products/identity/views/method-select.d.ts +0 -42
- package/dist/products/identity/views/origin-not-allowed.d.ts +0 -25
- package/dist/products/identity/views/otp-verify.d.ts +0 -58
- package/dist/products/identity/views/passkey-auto.d.ts +0 -22
- package/dist/products/identity/views/passkey-prompt.d.ts +0 -25
- package/dist/products/identity/views/passkey.d.ts +0 -38
- package/dist/products/identity/views/product-not-configured.d.ts +0 -21
- package/dist/products/identity/views/service-unavailable.d.ts +0 -21
- package/dist/products/identity/views/sms-consent.d.ts +0 -16
- package/dist/products/identity/views/sparklink-waiting.d.ts +0 -40
- package/dist/products/identity/views/two-factor.d.ts +0 -37
- package/dist/products/index.d.ts +0 -51
- package/dist/products/messaging/index.d.ts +0 -38
- package/dist/products/messaging/types.d.ts +0 -162
- package/dist/products/notify/index.d.ts +0 -436
- package/dist/products/notify/project-types.d.ts +0 -44
- package/dist/products/notify/projects.d.ts +0 -15
- package/dist/products/notify/types.d.ts +0 -1327
- package/dist/products/structured-ingots/index.d.ts +0 -31
- package/dist/products/structured-ingots/types-client.d.ts +0 -19
- package/dist/products/structured-ingots/types.d.ts +0 -293
- package/dist/products/structured-ingots/validation.d.ts +0 -25
- package/dist/request-path.d.ts +0 -44
- package/dist/sparks/index.d.ts +0 -91
- package/dist/sparks/types.d.ts +0 -304
- package/dist/ui/chrome.d.ts +0 -16
- package/dist/ui/ds-tokens.d.ts +0 -59
- package/dist/ui/inline-shell.d.ts +0 -19
- package/dist/ui/live-region.d.ts +0 -15
- package/dist/ui/modal-shell.d.ts +0 -67
- package/dist/ui/target.d.ts +0 -6
- package/dist/utils/dom.d.ts +0 -26
- package/dist/vault-session.d.ts +0 -2
- package/dist/vaults/index.d.ts +0 -254
- package/dist/vaults/types.d.ts +0 -368
- package/dist/vaults/upload/api.d.ts +0 -310
- package/dist/vaults/upload/chrome.d.ts +0 -21
- package/dist/vaults/upload/container.d.ts +0 -37
- package/dist/vaults/upload/index.d.ts +0 -76
- package/dist/vaults/upload/inline-container.d.ts +0 -41
- package/dist/vaults/upload/modal.d.ts +0 -55
- package/dist/vaults/upload/renderer.d.ts +0 -150
- package/dist/vaults/upload/styles.d.ts +0 -14
- package/dist/vaults/upload/types.d.ts +0 -220
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
- `data-account-id` initializes the SDK, and `window.SparkVault` is the instance; without it `window.SparkVault` is the class (`SparkVault.init({ accountId })`). `data-debug="true"` logs verbosely.
|
|
32
32
|
- Load it as a plain script, ahead of the code that calls it: an `async` script runs whenever its download completes, so an inline script after it can find `SparkVault` unset.
|
|
33
|
-
- `sdk/v1/sparkvault.js` is the stable URL, replaced by each release (bust with `?v=<version>`). To pin one build,
|
|
33
|
+
- `sdk/v1/sparkvault.js` is the stable URL, replaced by each release (bust with `?v=<version>`). To pin one build, read the full SDK's top-level `version`, `hash`, `umd` and `integrity` fields from `https://cdn.sparkvault.com/sdk/v1/version.json`:
|
|
34
34
|
|
|
35
35
|
```html
|
|
36
36
|
<script
|
|
@@ -48,13 +48,35 @@ npm install @sparkvault/sdk-js
|
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
```js
|
|
51
|
-
import SparkVault from '@sparkvault/sdk-js'; // ESM → dist/index.mjs
|
|
52
|
-
const { SparkVault } = require('@sparkvault/sdk-js'); // CJS → dist/index.cjs
|
|
51
|
+
import SparkVault from '@sparkvault/sdk-js'; // ESM → dist/npm/index.mjs
|
|
52
|
+
const { SparkVault } = require('@sparkvault/sdk-js'); // CJS → dist/npm/index.cjs
|
|
53
53
|
|
|
54
54
|
const sv = SparkVault.init({ accountId: 'acc_YOUR_ACCOUNT_ID' });
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
Types ship in `dist/index.d.ts` (the sign-in result is `VerifyResult`); the `browser` field is the UMD bundle the CDN serves (`dist/sparkvault.js`).
|
|
57
|
+
Types ship in `dist/types/index.d.ts` (the sign-in result is `VerifyResult`); the `browser` field is the UMD bundle the CDN serves (`dist/sparkvault.js`).
|
|
58
|
+
|
|
59
|
+
### Identity entry
|
|
60
|
+
|
|
61
|
+
- Import `@sparkvault/sdk-js/identity` when a page only needs sign-in. It uses the same configuration, validation, popup and recovery implementation as `products.identity`, without bundling the other products.
|
|
62
|
+
- `init(config)` returns the Identity module directly. Importing the entry does not initialize an account or change `window.SparkVault`.
|
|
63
|
+
- `isRecoveryPending()` detects a return that needs completing without consuming it or initializing Identity; `version` identifies the package release.
|
|
64
|
+
|
|
65
|
+
```js
|
|
66
|
+
import { init, isRecoveryPending } from '@sparkvault/sdk-js/identity';
|
|
67
|
+
|
|
68
|
+
const identity = init({ accountId: 'acc_YOUR_ACCOUNT_ID' });
|
|
69
|
+
identity.attach('.login-btn', { onSuccess: signInToApp });
|
|
70
|
+
if (isRecoveryPending()) {
|
|
71
|
+
identity.handleRedirectResult({ onSuccess: signInToApp })
|
|
72
|
+
.catch((error) => console.error('Sign-in failed:', error.message));
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
- `signInToApp` sends the returned token to your backend for verification, as in the quickstart below.
|
|
77
|
+
- ESM and CommonJS resolve to `dist/npm/identity.mjs` and `dist/npm/identity.cjs`; types resolve to `dist/types/identity.d.ts`. All exports are named. Package entries share their class constructors within each format and one declaration graph, so existing helpers typed against the root Identity module accept this entry's instances.
|
|
78
|
+
- For a script tag, load `https://cdn.sparkvault.com/sdk/v1/sparkvault-identity.js` before your consumer script, then call `SparkVaultIdentity.init(config)`. It does not read `data-account-id` or initialize automatically.
|
|
79
|
+
- The `identity` descriptor in `https://cdn.sparkvault.com/sdk/v1/version.json` names the immutable `sparkvault-identity.<hash>.js` and its SRI `integrity`; the manifest's top-level `version` applies to both entries.
|
|
58
80
|
|
|
59
81
|
## Quickstart: sign in
|
|
60
82
|
|