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@latest/dist/sophi.min.js | Latest published version |
https://cdn.jsdelivr.net/npm/@usesophi/sophi-web-object@x.y.z/dist/sophi.min.js | Pinned version (replace x.y.z) |
@latest is fine for development. For production, pin a semver in the URL (or in a GTM Constant — see GTM integration) so upgrades are explicit.
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, best practices, and a short events cheat sheet.
For copy-paste HTML and npm snippets without the full decision tree, 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
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.