@sparkvault/sdk-js 7.0.2 → 8.0.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.
Files changed (2) hide show
  1. package/README.md +29 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -41,6 +41,35 @@ yarn add @sparkvault/sdk-js
41
41
  - `sparkvault.esm.js` — ES modules for modern bundlers
42
42
  - `sparkvault.cjs.js` — CommonJS for Node.js
43
43
 
44
+ ### Caching & version pinning
45
+
46
+ The CDN serves the browser bundle in two tiers:
47
+
48
+ | URL | Cache | Use when |
49
+ |-----|-------|----------|
50
+ | `sdk/v1/sparkvault.js` | `max-age=300` (auto-updates) | Default. You always get the latest release within ~5 min. |
51
+ | `sdk/v1/sparkvault.<hash>.js` | `immutable`, 1 year | You want a reproducible, forever-cached, integrity-pinned build. |
52
+
53
+ `sdk/v1/version.json` advertises the current immutable URL, its hash, and a
54
+ Subresource Integrity (SRI) digest:
55
+
56
+ ```json
57
+ { "version": "7.0.1", "hash": "f771160fa23a09d8", "umd": "sparkvault.f771160fa23a09d8.js", "integrity": "sha384-…" }
58
+ ```
59
+
60
+ To pin a build with integrity verification:
61
+
62
+ ```html
63
+ <script
64
+ src="https://cdn.sparkvault.com/sdk/v1/sparkvault.f771160fa23a09d8.js"
65
+ integrity="sha384-…"
66
+ crossorigin="anonymous"
67
+ ></script>
68
+ ```
69
+
70
+ Pinning trades automatic updates for a byte-stable, forever-cached asset — you
71
+ update by pointing at the next `version.json` entry.
72
+
44
73
  ## CDN Auto-Init
45
74
 
46
75
  ```html
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparkvault/sdk-js",
3
- "version": "7.0.2",
3
+ "version": "8.0.0",
4
4
  "description": "SparkVault JavaScript SDK - Identity Verification and Encrypted Vaults",
5
5
  "type": "module",
6
6
  "main": "dist/sparkvault.cjs.js",