Installation
The npm package is @usesophi/sophi-web-object. Artifacts live under dist/ in the package.
The npm package is @usesophi/sophi-web-object. Artifacts live under dist/ in the package.
| File | Use case |
|---|---|
sophi.min.js | Production: <script src="..."> or GTM Custom HTML |
sophi.js | Debugging (source maps, readable bundle) |
sophi.esm.js | Bundlers / dynamic import |
jsDelivr CDN
| URL | Resolves to |
|---|---|
https://cdn.jsdelivr.net/npm/@usesophi/sophi-web-object@1.3.x/dist/sophi.min.js | Latest 1.3.x patch — automatically picks the newest compatible patch within the 1.3 minor line; includes built-in pre-load queue |
https://cdn.jsdelivr.net/npm/@usesophi/sophi-web-object@x.y.z/dist/sophi.min.js | Any pinned version (replace x.y.z) |
Always pin an exact semver in production URLs — never use @latest. This ensures a new SDK release cannot change behaviour until you deliberately update the URL.
Where to go next
Step-by-step setup lives in one of these pages—pick one and follow it through:
- GTM integration — Google Tag Manager, consent-gated load, upgrade path via a Constant variable.
- Integration guide — Choosing GTM vs script vs npm, the required pre-load stub snippet, and a short events cheat sheet.
For a copy-paste HTML snippet with the pre-load stub and all warnings, the integration guide is the quickest read.
Next steps
- Configuration —
apiKey,userId, retries, debounce, debug - Window object layer — watched keys and payloads
- SophiTracker API — SPA updates and pre-load queue behavior
Integration guide
How to deliver @usesophi/sophi-web-object to your storefront — choose between GTM, npm/bundler, or CDN script tag depending on your stack.
Configuration
All runtime settings for the Sophi Web Object, provided via window.sophi_object.config including apiKey, userId, maxRetries, debounceMs, debug, and storageConsent.