Browser SDK for CertNode receipt verification (ESM, WebCrypto)
npm install @certnode/sdk-webESM browser SDK for verifying CertNode receipts using WebCrypto (ES256 / P‑256).
- Via npm (recommended): npm install @certnode/sdk-web
- Via CDN (after publish):
- ESM:
- UMD/global (compat): use web/js/verify.js from this repo and reference window.CertNode.verifyReceipt.
- Minified ESM (package dist): import sdk/web/dist/index.esm.min.js in your bundler if preferred
``html`
- Only ES256 (ECDSA P‑256) is supported.
- Uses RFC8785 JCS for canonicalization when payload_jcs_sha256 is present.JWKSManager
- No dependencies; requires a browser with WebCrypto support.
- Optional JWKS cache helper included as (TTL + ETag/Last‑Modified)dist/index.esm.min.js
- A minified ESM bundle is generated at for convenience
- Type definitions included via index.d.ts.
MIT
If you prefer loading from a CDN, you can use jsDelivr and optionally add Subresource Integrity (SRI).
Compute SRI:
``
npm run build:web-sdk
node tools/generate-sri.js
Then include the script:
`html``
type="module"
integrity="sha384-..."
crossorigin="anonymous"
src="https://cdn.jsdelivr.net/npm/@certnode/sdk-web@X.Y.Z/dist/index.esm.min.js">