@elliemae/pui-logrocket 1.1.31-alpha.2 → 1.1.31

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 (38) hide show
  1. package/build/docs/404.html +2 -2
  2. package/build/docs/api/functions/buildLogRocketQueryParams/index.html +2 -2
  3. package/build/docs/api/functions/hasUserConsentedToSessionRecording/index.html +2 -2
  4. package/build/docs/api/functions/initLogRocket/index.html +2 -2
  5. package/build/docs/api/index.html +2 -2
  6. package/build/docs/api/type-aliases/LROptions/index.html +2 -2
  7. package/build/docs/assets/js/04ee7372.90effac0.js +1 -0
  8. package/build/docs/assets/js/{7392.9b9efade.js → 6143.8bf840e9.js} +1 -1
  9. package/build/docs/assets/js/{7666.20fc9126.js → 7666.99e92eb2.js} +2 -2
  10. package/build/docs/assets/js/e376fc56.8f124f07.js +1 -0
  11. package/build/docs/assets/js/main.d9838ecf.js +2 -0
  12. package/build/docs/assets/js/{runtime~main.3d977b82.js → runtime~main.16dcbf24.js} +1 -1
  13. package/build/docs/compliance/index.html +5 -4
  14. package/build/docs/index.html +2 -2
  15. package/build/docs/usage-guide/index.html +19 -7
  16. package/dist/cjs/logrocket.js +83 -33
  17. package/dist/esm/logrocket.js +83 -33
  18. package/dist/public/index.html +1 -1
  19. package/dist/public/js/emuiLogrocket.436f95cb9c84877fed75.js +45 -0
  20. package/dist/public/js/emuiLogrocket.436f95cb9c84877fed75.js.br +0 -0
  21. package/dist/public/js/emuiLogrocket.436f95cb9c84877fed75.js.gz +0 -0
  22. package/dist/public/js/emuiLogrocket.436f95cb9c84877fed75.js.map +1 -0
  23. package/dist/types/lib/typings/window.d.ts +8 -0
  24. package/dist/types/tsconfig.tsbuildinfo +1 -1
  25. package/dist/umd/index.js +19 -19
  26. package/dist/umd/index.js.br +0 -0
  27. package/dist/umd/index.js.gz +0 -0
  28. package/dist/umd/index.js.map +1 -1
  29. package/package.json +2 -2
  30. package/build/docs/assets/js/04ee7372.d0e26bed.js +0 -1
  31. package/build/docs/assets/js/e376fc56.66061206.js +0 -1
  32. package/build/docs/assets/js/main.45ae4108.js +0 -2
  33. package/dist/public/js/emuiLogrocket.6d5dc70c5627242e25d5.js +0 -45
  34. package/dist/public/js/emuiLogrocket.6d5dc70c5627242e25d5.js.br +0 -0
  35. package/dist/public/js/emuiLogrocket.6d5dc70c5627242e25d5.js.gz +0 -0
  36. package/dist/public/js/emuiLogrocket.6d5dc70c5627242e25d5.js.map +0 -1
  37. /package/build/docs/assets/js/{7666.20fc9126.js.LICENSE.txt → 7666.99e92eb2.js.LICENSE.txt} +0 -0
  38. /package/build/docs/assets/js/{main.45ae4108.js.LICENSE.txt → main.d9838ecf.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- (()=>{"use strict";var e,a,r,t,o,c={},f={};function n(e){var a=f[e];if(void 0!==a)return a.exports;var r=f[e]={id:e,loaded:!1,exports:{}};return c[e].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.m=c,n.c=f,e=[],n.O=(a,r,t,o)=>{if(!r){var c=1/0;for(i=0;i<e.length;i++){for(var[r,t,o]=e[i],f=!0,d=0;d<r.length;d++)(!1&o||c>=o)&&Object.keys(n.O).every(e=>n.O[e](r[d]))?r.splice(d--,1):(f=!1,o<c&&(c=o));if(f){e.splice(i--,1);var b=t();void 0!==b&&(a=b)}}return a}o=o||0;for(var i=e.length;i>0&&e[i-1][2]>o;i--)e[i]=e[i-1];e[i]=[r,t,o]},n.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return n.d(a,{a:a}),a},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,n.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var o=Object.create(null);n.r(o);var c={};a=a||[null,r({}),r([]),r(r)];for(var f=2&t&&e;("object"==typeof f||"function"==typeof f)&&!~a.indexOf(f);f=r(f))Object.getOwnPropertyNames(f).forEach(a=>c[a]=()=>e[a]);return c.default=()=>e,n.d(o,c),o},n.d=(e,a)=>{for(var r in a)n.o(a,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((a,r)=>(n.f[r](e,a),a),[])),n.u=e=>"assets/js/"+({295:"51c4ceb1",594:"5e8c322a",2076:"common",3361:"c377a04b",3480:"e376fc56",4319:"211c08f1",4804:"7fcbe1af",5742:"aba21aa0",5754:"acaa8c75",5760:"552a934f",5908:"04ee7372",7098:"a7bd4aaa",8401:"17896441",9048:"a94703ab",9647:"5e95c892"}[e]||e)+"."+{200:"0310889b",295:"093ba7f1",483:"18c7d7f8",594:"503d46ea",638:"a021b03c",654:"0e97a121",764:"32783b8e",967:"d428fcf6",1138:"aa8c4e98",1370:"c8be4ee0",2076:"6c804366",2180:"31d6ce39",2327:"251d6533",2706:"74774645",3308:"78e397d4",3361:"2361a76f",3480:"66061206",3725:"36fa16ca",3767:"2998632d",3899:"94243d47",4167:"eb3f034b",4319:"f5d0523b",4359:"6536c7a0",4390:"744aab40",4413:"e614d609",4453:"ef8b090c",4632:"aa312ff7",4804:"5999b9e8",4860:"cfa79720",5168:"97fb36dd",5179:"ccfc9ebc",5182:"30f41439",5275:"4ed9ae52",5742:"a5d4e000",5754:"70525e75",5760:"b125f196",5820:"2cd5bf53",5908:"d0e26bed",6340:"eaf6d37a",6376:"13262bdb",6603:"cbc20a0f",6761:"0b26728e",6873:"83ee6c7c",7039:"3ca79f91",7098:"ad524078",7204:"1ce9a9b1",7392:"9b9efade",7616:"6501b368",7666:"20fc9126",7876:"3ac89535",8071:"6922ccd8",8401:"dfa22f5b",8907:"4424af8f",9048:"5c63b074",9647:"2d99be36",9748:"cc3f89d3",9845:"d704e0f2"}[e]+".js",n.miniCssF=e=>{},n.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),t={},o="@elliemae/pui-logrocket:",n.l=(e,a,r,c)=>{if(t[e])t[e].push(a);else{var f,d;if(void 0!==r)for(var b=document.getElementsByTagName("script"),i=0;i<b.length;i++){var l=b[i];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+r){f=l;break}}f||(d=!0,(f=document.createElement("script")).charset="utf-8",n.nc&&f.setAttribute("nonce",n.nc),f.setAttribute("data-webpack",o+r),f.src=e),t[e]=[a];var u=(a,r)=>{f.onerror=f.onload=null,clearTimeout(s);var o=t[e];if(delete t[e],f.parentNode&&f.parentNode.removeChild(f),o&&o.forEach(e=>e(r)),a)return a(r)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=u.bind(null,f.onerror),f.onload=u.bind(null,f.onload),d&&document.head.appendChild(f)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/logrocket/",n.gca=function(e){return e={17896441:"8401","51c4ceb1":"295","5e8c322a":"594",common:"2076",c377a04b:"3361",e376fc56:"3480","211c08f1":"4319","7fcbe1af":"4804",aba21aa0:"5742",acaa8c75:"5754","552a934f":"5760","04ee7372":"5908",a7bd4aaa:"7098",a94703ab:"9048","5e95c892":"9647"}[e]||e,n.p+n.u(e)},(()=>{var e={5354:0,1869:0};n.f.j=(a,r)=>{var t=n.o(e,a)?e[a]:void 0;if(0!==t)if(t)r.push(t[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var o=new Promise((r,o)=>t=e[a]=[r,o]);r.push(t[2]=o);var c=n.p+n.u(a),f=new Error;n.l(c,r=>{if(n.o(e,a)&&(0!==(t=e[a])&&(e[a]=void 0),t)){var o=r&&("load"===r.type?"missing":r.type),c=r&&r.target&&r.target.src;f.message="Loading chunk "+a+" failed.\n("+o+": "+c+")",f.name="ChunkLoadError",f.type=o,f.request=c,t[1](f)}},"chunk-"+a,a)}},n.O.j=a=>0===e[a];var a=(a,r)=>{var t,o,[c,f,d]=r,b=0;if(c.some(a=>0!==e[a])){for(t in f)n.o(f,t)&&(n.m[t]=f[t]);if(d)var i=d(n)}for(a&&a(r);b<c.length;b++)o=c[b],n.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return n.O(i)},r=globalThis.webpackChunk_elliemae_pui_logrocket=globalThis.webpackChunk_elliemae_pui_logrocket||[];r.forEach(a.bind(null,0)),r.push=a.bind(null,r.push.bind(r))})()})();
1
+ (()=>{"use strict";var e,a,r,t,o,c={},f={};function n(e){var a=f[e];if(void 0!==a)return a.exports;var r=f[e]={id:e,loaded:!1,exports:{}};return c[e].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.m=c,n.c=f,e=[],n.O=(a,r,t,o)=>{if(!r){var c=1/0;for(i=0;i<e.length;i++){for(var[r,t,o]=e[i],f=!0,d=0;d<r.length;d++)(!1&o||c>=o)&&Object.keys(n.O).every(e=>n.O[e](r[d]))?r.splice(d--,1):(f=!1,o<c&&(c=o));if(f){e.splice(i--,1);var b=t();void 0!==b&&(a=b)}}return a}o=o||0;for(var i=e.length;i>0&&e[i-1][2]>o;i--)e[i]=e[i-1];e[i]=[r,t,o]},n.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return n.d(a,{a:a}),a},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,n.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var o=Object.create(null);n.r(o);var c={};a=a||[null,r({}),r([]),r(r)];for(var f=2&t&&e;("object"==typeof f||"function"==typeof f)&&!~a.indexOf(f);f=r(f))Object.getOwnPropertyNames(f).forEach(a=>c[a]=()=>e[a]);return c.default=()=>e,n.d(o,c),o},n.d=(e,a)=>{for(var r in a)n.o(a,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((a,r)=>(n.f[r](e,a),a),[])),n.u=e=>"assets/js/"+({295:"51c4ceb1",594:"5e8c322a",2076:"common",3361:"c377a04b",3480:"e376fc56",4319:"211c08f1",4804:"7fcbe1af",5742:"aba21aa0",5754:"acaa8c75",5760:"552a934f",5908:"04ee7372",7098:"a7bd4aaa",8401:"17896441",9048:"a94703ab",9647:"5e95c892"}[e]||e)+"."+{200:"0310889b",295:"093ba7f1",483:"18c7d7f8",594:"503d46ea",638:"a021b03c",654:"0e97a121",764:"32783b8e",967:"d428fcf6",1138:"aa8c4e98",1370:"c8be4ee0",2076:"6c804366",2180:"31d6ce39",2327:"251d6533",2706:"74774645",3308:"78e397d4",3361:"2361a76f",3480:"8f124f07",3725:"36fa16ca",3767:"2998632d",3899:"94243d47",4167:"eb3f034b",4319:"f5d0523b",4359:"6536c7a0",4390:"744aab40",4413:"e614d609",4453:"ef8b090c",4632:"aa312ff7",4804:"5999b9e8",4860:"cfa79720",5168:"97fb36dd",5179:"ccfc9ebc",5182:"30f41439",5275:"4ed9ae52",5742:"a5d4e000",5754:"70525e75",5760:"b125f196",5820:"2cd5bf53",5908:"90effac0",6143:"8bf840e9",6340:"eaf6d37a",6376:"13262bdb",6603:"cbc20a0f",6761:"0b26728e",6873:"83ee6c7c",7039:"3ca79f91",7098:"ad524078",7204:"1ce9a9b1",7616:"6501b368",7666:"99e92eb2",7876:"3ac89535",8071:"6922ccd8",8401:"dfa22f5b",8907:"4424af8f",9048:"5c63b074",9647:"2d99be36",9748:"cc3f89d3",9845:"d704e0f2"}[e]+".js",n.miniCssF=e=>{},n.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),t={},o="@elliemae/pui-logrocket:",n.l=(e,a,r,c)=>{if(t[e])t[e].push(a);else{var f,d;if(void 0!==r)for(var b=document.getElementsByTagName("script"),i=0;i<b.length;i++){var l=b[i];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+r){f=l;break}}f||(d=!0,(f=document.createElement("script")).charset="utf-8",n.nc&&f.setAttribute("nonce",n.nc),f.setAttribute("data-webpack",o+r),f.src=e),t[e]=[a];var u=(a,r)=>{f.onerror=f.onload=null,clearTimeout(s);var o=t[e];if(delete t[e],f.parentNode&&f.parentNode.removeChild(f),o&&o.forEach(e=>e(r)),a)return a(r)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=u.bind(null,f.onerror),f.onload=u.bind(null,f.onload),d&&document.head.appendChild(f)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/logrocket/",n.gca=function(e){return e={17896441:"8401","51c4ceb1":"295","5e8c322a":"594",common:"2076",c377a04b:"3361",e376fc56:"3480","211c08f1":"4319","7fcbe1af":"4804",aba21aa0:"5742",acaa8c75:"5754","552a934f":"5760","04ee7372":"5908",a7bd4aaa:"7098",a94703ab:"9048","5e95c892":"9647"}[e]||e,n.p+n.u(e)},(()=>{var e={5354:0,1869:0};n.f.j=(a,r)=>{var t=n.o(e,a)?e[a]:void 0;if(0!==t)if(t)r.push(t[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var o=new Promise((r,o)=>t=e[a]=[r,o]);r.push(t[2]=o);var c=n.p+n.u(a),f=new Error;n.l(c,r=>{if(n.o(e,a)&&(0!==(t=e[a])&&(e[a]=void 0),t)){var o=r&&("load"===r.type?"missing":r.type),c=r&&r.target&&r.target.src;f.message="Loading chunk "+a+" failed.\n("+o+": "+c+")",f.name="ChunkLoadError",f.type=o,f.request=c,t[1](f)}},"chunk-"+a,a)}},n.O.j=a=>0===e[a];var a=(a,r)=>{var t,o,[c,f,d]=r,b=0;if(c.some(a=>0!==e[a])){for(t in f)n.o(f,t)&&(n.m[t]=f[t]);if(d)var i=d(n)}for(a&&a(r);b<c.length;b++)o=c[b],n.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return n.O(i)},r=globalThis.webpackChunk_elliemae_pui_logrocket=globalThis.webpackChunk_elliemae_pui_logrocket||[];r.forEach(a.bind(null,0)),r.push=a.bind(null,r.push.bind(r))})()})();
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="generator" content="Docusaurus v3.9.2">
6
6
  <title data-rh="true">Compliance Requirements | LogRocket</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://pui.ice.com/logrocket/compliance"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Compliance Requirements | LogRocket"><meta data-rh="true" name="description" content="Due to wiretapping &amp; privacy laws in certain jurisdictions, it is essential to ensure that our session recording practices comply with local regulations. Below are the key compliance requirements we need to adhere to when using LogRocket for recording user sessions and activities,"><meta data-rh="true" property="og:description" content="Due to wiretapping &amp; privacy laws in certain jurisdictions, it is essential to ensure that our session recording practices comply with local regulations. Below are the key compliance requirements we need to adhere to when using LogRocket for recording user sessions and activities,"><link data-rh="true" rel="icon" href="/logrocket/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://pui.ice.com/logrocket/compliance"><link data-rh="true" rel="alternate" href="https://pui.ice.com/logrocket/compliance" hreflang="en"><link data-rh="true" rel="alternate" href="https://pui.ice.com/logrocket/compliance" hreflang="x-default"><script data-rh="true" type="application/ld+json">{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Compliance Requirements","item":"https://pui.ice.com/logrocket/compliance"}]}</script><link rel="stylesheet" href="/logrocket/assets/css/styles.48d5ef50.css">
7
- <script src="/logrocket/assets/js/runtime~main.3d977b82.js" defer="defer"></script>
8
- <script src="/logrocket/assets/js/main.45ae4108.js" defer="defer"></script>
7
+ <script src="/logrocket/assets/js/runtime~main.16dcbf24.js" defer="defer"></script>
8
+ <script src="/logrocket/assets/js/main.d9838ecf.js" defer="defer"></script>
9
9
  </head>
10
10
  <body class="navigation-with-keyboard">
11
11
  <svg style="display: none;"><defs>
@@ -248,13 +248,14 @@
248
248
  <h4 class="anchor anchorTargetStickyNavbar_UXZL" id="url-sanitization">URL Sanitization<a href="#url-sanitization" class="hash-link" aria-label="Direct link to URL Sanitization" title="Direct link to URL Sanitization" translate="no">​</a></h4>
249
249
  <p>Sensitive URL parameters are automatically redacted:</p>
250
250
  <ul>
251
- <li class="">Authorization codes: <code>code=REDACTED</code></li>
251
+ <li class="">Authorization codes: The standalone <code>code</code> query parameter is redacted to <code>code=REDACTED</code> (does not affect parameters like <code>zipcode</code> or <code>promo_code</code>)</li>
252
+ <li class="">All occurrences of the <code>code</code> parameter in the URL are redacted</li>
252
253
  <li class="">Custom patterns can be added via the <code>browser.urlSanitizer</code> configuration</li>
253
254
  </ul>
254
255
  <h4 class="anchor anchorTargetStickyNavbar_UXZL" id="network-sanitization">Network Sanitization<a href="#network-sanitization" class="hash-link" aria-label="Direct link to Network Sanitization" title="Direct link to Network Sanitization" translate="no">​</a></h4>
255
256
  <p>Network requests and responses are sanitized to prevent sensitive data leakage:</p>
256
257
  <ul>
257
- <li class=""><strong>Request headers</strong>: Authorization headers are replaced with <code>**redacted**</code></li>
258
+ <li class=""><strong>Request headers</strong>: Authorization headers are replaced with <code>**redacted**</code> (case-insensitive matching)</li>
258
259
  <li class=""><strong>Request bodies</strong>: All request bodies are set to <code>null</code> by default</li>
259
260
  <li class=""><strong>Response bodies</strong>: All response bodies are removed by default</li>
260
261
  <li class=""><strong>Custom headers</strong>: Headers like <code>x-secret</code> trigger complete response removal</li>
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="generator" content="Docusaurus v3.9.2">
6
6
  <title data-rh="true">Getting Started | LogRocket</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://pui.ice.com/logrocket/"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Getting Started | LogRocket"><meta data-rh="true" name="description" content="UI Platform LogRocket library standardizes the way we integrate LogRocket into our applications."><meta data-rh="true" property="og:description" content="UI Platform LogRocket library standardizes the way we integrate LogRocket into our applications."><link data-rh="true" rel="icon" href="/logrocket/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://pui.ice.com/logrocket/"><link data-rh="true" rel="alternate" href="https://pui.ice.com/logrocket/" hreflang="en"><link data-rh="true" rel="alternate" href="https://pui.ice.com/logrocket/" hreflang="x-default"><script data-rh="true">function insertBanner(){var n=document.createElement("div");n.id="__docusaurus-base-url-issue-banner-container";n.innerHTML='\n<div id="__docusaurus-base-url-issue-banner" style="border: thick solid red; background-color: rgb(255, 230, 179); margin: 20px; padding: 20px; font-size: 20px;">\n <p style="font-weight: bold; font-size: 30px;">Your Docusaurus site did not load properly.</p>\n <p>A very common reason is a wrong site <a href="https://docusaurus.io/docs/docusaurus.config.js/#baseUrl" style="font-weight: bold;">baseUrl configuration</a>.</p>\n <p>Current configured baseUrl = <span style="font-weight: bold; color: red;">/logrocket/</span> </p>\n <p>We suggest trying baseUrl = <span id="__docusaurus-base-url-issue-banner-suggestion-container" style="font-weight: bold; color: green;"></span></p>\n</div>\n',document.body.prepend(n);var e=document.getElementById("__docusaurus-base-url-issue-banner-suggestion-container"),o=window.location.pathname,s="/"===o.substr(-1)?o:o+"/";e.innerHTML=s}document.addEventListener("DOMContentLoaded",function(){void 0===window.docusaurus&&insertBanner()})</script><script data-rh="true" type="application/ld+json">{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Getting Started","item":"https://pui.ice.com/logrocket/"}]}</script><link rel="stylesheet" href="/logrocket/assets/css/styles.48d5ef50.css">
7
- <script src="/logrocket/assets/js/runtime~main.3d977b82.js" defer="defer"></script>
8
- <script src="/logrocket/assets/js/main.45ae4108.js" defer="defer"></script>
7
+ <script src="/logrocket/assets/js/runtime~main.16dcbf24.js" defer="defer"></script>
8
+ <script src="/logrocket/assets/js/main.d9838ecf.js" defer="defer"></script>
9
9
  </head>
10
10
  <body class="navigation-with-keyboard">
11
11
  <svg style="display: none;"><defs>
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="generator" content="Docusaurus v3.9.2">
6
6
  <title data-rh="true">Usage Guide | LogRocket</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://pui.ice.com/logrocket/usage-guide"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Usage Guide | LogRocket"><meta data-rh="true" name="description" content="UI Platform LogRocket library standardizes the way we integrate LogRocket into our applications."><meta data-rh="true" property="og:description" content="UI Platform LogRocket library standardizes the way we integrate LogRocket into our applications."><link data-rh="true" rel="icon" href="/logrocket/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://pui.ice.com/logrocket/usage-guide"><link data-rh="true" rel="alternate" href="https://pui.ice.com/logrocket/usage-guide" hreflang="en"><link data-rh="true" rel="alternate" href="https://pui.ice.com/logrocket/usage-guide" hreflang="x-default"><script data-rh="true" type="application/ld+json">{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Usage Guide","item":"https://pui.ice.com/logrocket/usage-guide"}]}</script><link rel="stylesheet" href="/logrocket/assets/css/styles.48d5ef50.css">
7
- <script src="/logrocket/assets/js/runtime~main.3d977b82.js" defer="defer"></script>
8
- <script src="/logrocket/assets/js/main.45ae4108.js" defer="defer"></script>
7
+ <script src="/logrocket/assets/js/runtime~main.16dcbf24.js" defer="defer"></script>
8
+ <script src="/logrocket/assets/js/main.d9838ecf.js" defer="defer"></script>
9
9
  </head>
10
10
  <body class="navigation-with-keyboard">
11
11
  <svg style="display: none;"><defs>
@@ -34,7 +34,7 @@
34
34
  <li class=""><code>localhostEnable</code> (boolean): Flag to enable LogRocket when running on localhost. Defaults to <code>false</code>. When set to <code>true</code>, LogRocket will be enabled on localhost even if the <code>LOGROCKET_ENABLE_ON_LOCALHOST</code> environment variable is not set. This is useful for local development and testing.</li>
35
35
  <li class=""><code>childDomains</code> (array of strings): List of domains of child micro applications (e.g., iframes). Only include domains for cross-origin child microapps.</li>
36
36
  <li class=""><code>parentDomain</code> (string): Parent domain of the hosting application. library automatically detects parent domain for cross-origin iframes.</li>
37
- <li class=""><code>rootHostname</code> (string): Use this option to control whether sessions that traverse different subdomains on your product application are kept intact or broken up into sessions specific to each microapp subdomain. Set this to the highest-level hostname sessions should be shared across (e.g., .ice.com). A leading period is required. Defaults to .ice.com</li>
37
+ <li class=""><code>rootHostname</code> (string): Use this option to control whether sessions that traverse different subdomains on your product application are kept intact or broken up into sessions specific to each microapp subdomain. Set this to the highest-level hostname sessions should be shared across (e.g., <code>.ice.com</code>). A leading period is required. When not specified, the library auto-detects the root hostname by extracting the last two segments of the top-level window&#x27;s hostname and validating it against the allowed domains: <code>.ice.com</code>, <code>.elliemae.com</code>, <code>.encompassloconnect.com</code>, <code>.ellielabs.com</code>, <code>.elliemae.io</code>, <code>.intcx.net</code>. For example, <code>beta.encompass.elliemae.io</code> resolves to <code>.elliemae.io</code>. If the hostname doesn&#x27;t match any allowed domain, <code>rootHostname</code> is omitted and LogRocket scopes the session cookie to the current page&#x27;s hostname.</li>
38
38
  </ul>
39
39
  <h2 class="anchor anchorTargetStickyNavbar_UXZL" id="testing-logrocket-integration-from-localhost">Testing LogRocket Integration from Localhost<a href="#testing-logrocket-integration-from-localhost" class="hash-link" aria-label="Direct link to Testing LogRocket Integration from Localhost" title="Direct link to Testing LogRocket Integration from Localhost" translate="no">​</a></h2>
40
40
  <p>When developing locally, you may want to test LogRocket integration. There are two ways to enable LogRocket on localhost:</p>
@@ -70,8 +70,9 @@
70
70
  <p>The library uses OneTrust&#x27;s event system to determine when to initialize LogRocket based on the user&#x27;s consent banner state:</p>
71
71
  <p><strong>First-time visitors</strong> (no <code>OptanonAlertBoxClosed</code> cookie):</p>
72
72
  <ul>
73
- <li class="">The library listens for the <code>OTConsentApplied</code> event</li>
74
- <li class="">This event fires when the user first interacts with the consent banner (Accept/Decline)</li>
73
+ <li class="">The library first checks if the C0002 consent group is already active in <code>window.OnetrustActiveGroups</code></li>
74
+ <li class="">If C0002 is already present (non-rejectable, as in internal apps like EncompassWeb/TPO), LogRocket initializes immediately without waiting for banner interaction</li>
75
+ <li class="">If C0002 is not yet active, the library listens for the <code>OTConsentApplied</code> event, which fires when the user first interacts with the consent banner (Accept/Decline)</li>
75
76
  <li class="">LogRocket initializes immediately after the user makes their choice</li>
76
77
  </ul>
77
78
  <p><strong>Returning visitors</strong> (has <code>OptanonAlertBoxClosed</code> cookie):</p>
@@ -80,12 +81,22 @@
80
81
  <li class="">This event fires when OneTrust SDK loads and updates the consent groups</li>
81
82
  <li class="">LogRocket initializes once the consent groups are available</li>
82
83
  </ul>
84
+ <p><strong>Timeout fallback</strong>:</p>
85
+ <ul>
86
+ <li class="">If the expected OneTrust event (<code>OTConsentApplied</code> or <code>OneTrustGroupsUpdated</code>) is not received within 10 seconds, the library initializes LogRocket with the current consent state and logs a warning</li>
87
+ <li class="">This prevents LogRocket from being permanently blocked if the OneTrust SDK fails to load or fire events</li>
88
+ </ul>
89
+ <p><strong>Init failure recovery</strong>:</p>
90
+ <ul>
91
+ <li class="">If LogRocket initialization fails (e.g., due to a network error or invalid configuration), the <code>isLogRocketInitialized</code> flag is reset to <code>false</code>, allowing a retry on the next call to <code>initLogRocket</code></li>
92
+ </ul>
83
93
  <p>This event-based approach ensures that:</p>
84
94
  <ul>
85
95
  <li class="">LogRocket only initializes when consent status is available</li>
86
- <li class="">First-time users see immediate feedback when they consent</li>
96
+ <li class="">Internal apps with non-rejectable consent groups initialize immediately</li>
97
+ <li class="">First-time users of consumer apps see immediate feedback when they consent</li>
87
98
  <li class="">Returning users get automatic initialization without re-showing the banner</li>
88
- <li class="">The integration is more reliable than the legacy callback approach</li>
99
+ <li class="">The integration is resilient to OneTrust SDK failures via the timeout fallback</li>
89
100
  </ul>
90
101
  <p>The library automatically applies privacy-focused defaults including:</p>
91
102
  <ul>
@@ -108,6 +119,7 @@
108
119
  <li class=""><strong><code>lrEnabled</code></strong>: Set to <code>&#x27;true&#x27;</code> if LogRocket is enabled in the app, <code>&#x27;false&#x27;</code> otherwise</li>
109
120
  <li class=""><strong><code>lrAppId</code></strong>: The LogRocket application ID being used in the app</li>
110
121
  </ul>
122
+ <p><strong>Important</strong>: After <code>initLogRocket</code> completes, <code>buildLogRocketQueryParams</code> returns the consent and enabled state captured at initialization time (stored in <code>window.emui.lrSessionRecordingConsent</code> and <code>window.emui.lrEnabled</code>). This ensures child iframes always reflect the parent app&#x27;s actual initialization state, even if the user changes consent preferences after initialization. If called before <code>initLogRocket</code>, it evaluates the current live state as a fallback.</p>
111
123
  <div class="language-javascript codeBlockContainer_hfT5 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_7tLg"><pre tabindex="0" class="prism-code language-javascript codeBlock_jGqy thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_reRH"><span class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic">// parent microapplication</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword module" style="color:#00009f">import</span><span class="token plain"> </span><span class="token imports punctuation" style="color:#393A34">{</span><span class="token imports"> buildLogRocketQueryParams </span><span class="token imports punctuation" style="color:#393A34">}</span><span class="token plain"> </span><span class="token keyword module" style="color:#00009f">from</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">&#x27;@elliemae/pui-logrocket&#x27;</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> urlParams </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token function" style="color:#d73a49">buildLogRocketQueryParams</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic">// urlParams: &quot;analyticsConsent=true&amp;lrEnabled=true&amp;lrAppId=your-app-id&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> childUrl </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token template-string string" style="color:#e3116c">https://child-app.example.com?</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">${</span><span class="token template-string interpolation">urlParams</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:#393A34">}</span><span class="token template-string template-punctuation string" style="color:#e3116c">`</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic">// launch guest application with childUrl using SSF V2 / App SDK GuestMicroapp</span><br></span></code></pre></div></div>
112
124
  <h3 class="anchor anchorTargetStickyNavbar_UXZL" id="support-for-legacy-angularjs-microapps-in-iframes">Support for Legacy AngularJS Microapps in Iframes<a href="#support-for-legacy-angularjs-microapps-in-iframes" class="hash-link" aria-label="Direct link to Support for Legacy AngularJS Microapps in Iframes" title="Direct link to Support for Legacy AngularJS Microapps in Iframes" translate="no">​</a></h3>
113
125
  <p>For older AngularJS-based microapplications running inside iframes, the library automatically reads the <code>analyticsConsent</code> parameter from the iframe&#x27;s <code>src</code> URL. This provides backward compatibility for legacy microapps that cannot directly access parent window variables or URL parameters.</p>
@@ -53,10 +53,10 @@ if (!scriptSrc) {
53
53
  } catch {
54
54
  }
55
55
  }
56
- if (scriptSrc && /(cdn\.mortgagetech\..*\.ice\.com|localhost)/.test(scriptSrc)) {
56
+ if (scriptSrc && /(cdn\.mortgagetech\..*\.ice\.com|\/\/localhost[\d:/])/.test(scriptSrc)) {
57
57
  try {
58
58
  const url = new URL(scriptSrc);
59
- cdnDomain = url.origin.includes("localhost") ? "https://cdn.mortgagetech.d1.ice.com" : url.origin;
59
+ cdnDomain = url.hostname === "localhost" ? "https://cdn.mortgagetech.d1.ice.com" : url.origin;
60
60
  } catch {
61
61
  cdnDomain = null;
62
62
  }
@@ -88,7 +88,30 @@ const getParentDomain = () => {
88
88
  };
89
89
  const removeCurrentWindowDomain = (domains) => {
90
90
  if (!domains || domains.length === 0) return null;
91
- return domains.filter((domain) => domain !== window.location.origin);
91
+ const filtered = domains.filter(
92
+ (domain) => domain !== window.location.origin
93
+ );
94
+ return filtered.length > 0 ? filtered : null;
95
+ };
96
+ const ALLOWED_ROOT_HOSTNAMES = [
97
+ ".ice.com",
98
+ ".elliemae.com",
99
+ ".encompassloconnect.com",
100
+ ".ellielabs.com",
101
+ ".elliemae.io",
102
+ ".intcx.net"
103
+ ];
104
+ const getRootHostname = () => {
105
+ let hostname;
106
+ try {
107
+ hostname = window.top?.location?.hostname ?? window.location.hostname;
108
+ } catch {
109
+ hostname = window.location.hostname;
110
+ }
111
+ const parts = hostname.split(".");
112
+ if (parts.length < 2) return null;
113
+ const rootDomain = `.${parts.slice(-2).join(".")}`;
114
+ return ALLOWED_ROOT_HOSTNAMES.includes(rootDomain) ? rootDomain : null;
92
115
  };
93
116
  const getDefaultOptions = () => {
94
117
  const filteredChildDomains = removeCurrentWindowDomain(
@@ -99,7 +122,10 @@ const getDefaultOptions = () => {
99
122
  browser: {
100
123
  urlSanitizer: (url) => {
101
124
  let sanitizedUrl = url;
102
- sanitizedUrl = sanitizedUrl.replace(/code=([^&]*)/, "code=REDACTED");
125
+ sanitizedUrl = sanitizedUrl.replace(
126
+ /([?&])code=([^&]*)/g,
127
+ "$1code=REDACTED"
128
+ );
103
129
  return sanitizedUrl;
104
130
  }
105
131
  },
@@ -120,12 +146,13 @@ const getDefaultOptions = () => {
120
146
  mergeIframes: true,
121
147
  network: {
122
148
  requestSanitizer: (request) => {
123
- const sanitizedRequest = { ...request };
124
- if (request.headers.Authorization) {
125
- sanitizedRequest.headers.Authorization = "**redacted**";
126
- }
149
+ const sanitizedHeaders = Object.keys(request.headers).reduce((acc, key) => {
150
+ acc[key] = /^authorization$/i.test(key) ? "**redacted**" : request.headers[key] ?? "";
151
+ return acc;
152
+ }, {});
127
153
  return {
128
- ...sanitizedRequest,
154
+ ...request,
155
+ headers: sanitizedHeaders,
129
156
  body: null
130
157
  };
131
158
  },
@@ -141,14 +168,15 @@ const getDefaultOptions = () => {
141
168
  },
142
169
  release: process?.env?.APP_VERSION,
143
170
  // app sdk based applications use this env variable to specify the app code version
144
- rootHostname: window.emui?.logRocketConfig?.rootHostname ?? ".ice.com",
171
+ rootHostname: window.emui?.logRocketConfig?.rootHostname ?? getRootHostname() ?? void 0,
145
172
  ...filteredChildDomains && filteredChildDomains.length > 0 ? { childDomains: filteredChildDomains } : {},
146
173
  ...parentDomain ? { parentDomain } : {}
147
174
  };
148
175
  };
176
+ const getActiveConsentGroups = () => window.OnetrustActiveGroups?.split(",").map((g) => g.trim()).filter(Boolean) ?? [];
149
177
  const hasUserConsentedForLogRocketInit = () => {
150
178
  if (window.OnetrustActiveGroups) {
151
- return window.OnetrustActiveGroups.includes("C0002");
179
+ return getActiveConsentGroups().includes("C0002");
152
180
  }
153
181
  return true;
154
182
  };
@@ -163,15 +191,6 @@ const isLogRocketDisabled = () => {
163
191
  if (window.emui?.logRocketConfig?.enable === false || urlParams.get("lrEnabled") === "false") {
164
192
  return true;
165
193
  }
166
- if (window.frameElement) {
167
- try {
168
- const frameUrl = new URL(window.frameElement.src);
169
- if (frameUrl.searchParams.get("lrEnabled") === "false") {
170
- return true;
171
- }
172
- } catch {
173
- }
174
- }
175
194
  return false;
176
195
  };
177
196
  const hasUserConsentedToSessionRecording = () => {
@@ -182,7 +201,7 @@ const hasUserConsentedToSessionRecording = () => {
182
201
  return window.emui.dangerouslyOverrideSessionRecordingConsent;
183
202
  }
184
203
  if (window.OnetrustActiveGroups) {
185
- return window.OnetrustActiveGroups.includes("C0003");
204
+ return getActiveConsentGroups().includes("C0003");
186
205
  }
187
206
  const urlParams = new URLSearchParams(window.location.search);
188
207
  if (urlParams.get("analyticsConsent") === "true") {
@@ -207,11 +226,10 @@ const getLRAppId = (appId) => {
207
226
  };
208
227
  const buildLogRocketQueryParams = () => {
209
228
  const urlParams = new URLSearchParams();
210
- urlParams.append(
211
- "analyticsConsent",
212
- hasUserConsentedToSessionRecording() === true ? "true" : "false"
213
- );
214
- urlParams.append("lrEnabled", isLogRocketDisabled() ? "false" : "true");
229
+ const consent = window.emui?.lrSessionRecordingConsent ?? hasUserConsentedToSessionRecording();
230
+ const enabled = window.emui?.lrEnabled ?? !isLogRocketDisabled();
231
+ urlParams.append("analyticsConsent", consent ? "true" : "false");
232
+ urlParams.append("lrEnabled", enabled ? "true" : "false");
215
233
  urlParams.append("lrAppId", getLRAppId() ?? "");
216
234
  return urlParams.toString();
217
235
  };
@@ -225,11 +243,14 @@ const init = (options) => {
225
243
  }
226
244
  if (isLogRocketDisabled()) {
227
245
  window.emui.isLogRocketInitialized = false;
246
+ window.emui.lrEnabled = false;
228
247
  getLogger().info("LogRocket is disabled in this environment");
229
248
  return;
230
249
  }
250
+ window.emui.lrEnabled = true;
231
251
  const defaultOptions = getDefaultOptions();
232
252
  const consent = hasUserConsentedToSessionRecording();
253
+ window.emui.lrSessionRecordingConsent = consent;
233
254
  if (defaultOptions.dom) {
234
255
  defaultOptions.dom.isEnabled = consent;
235
256
  }
@@ -247,31 +268,60 @@ const init = (options) => {
247
268
  };
248
269
  const hasSeenBanner = () => {
249
270
  const m = document.cookie.match(/(^|;\s*)OptanonAlertBoxClosed=([^;]+)/);
250
- return m ? !!decodeURIComponent(m[2]) : false;
271
+ if (!m) return false;
272
+ try {
273
+ return !!decodeURIComponent(m[2]);
274
+ } catch {
275
+ return false;
276
+ }
251
277
  };
252
278
  const initLogRocket = (options) => {
253
279
  if (window.emui.isLogRocketInitialized) return;
254
- lrAppId = getLRAppId(options?.appId);
255
- if (!lrAppId) {
280
+ if (!getLRAppId(options?.appId)) {
256
281
  throw new Error(
257
282
  "LogRocket appId is required to initialize LogRocket. Either pass it as parameter or set window.emui.logRocketConfig.appId"
258
283
  );
259
284
  }
260
285
  window.emui.isLogRocketInitialized = true;
261
286
  if (window.hasOneTrust) {
287
+ let handled = false;
262
288
  const handler = () => {
263
- init(options);
289
+ if (handled) return;
290
+ handled = true;
291
+ try {
292
+ init(options);
293
+ } catch (error) {
294
+ window.emui.isLogRocketInitialized = false;
295
+ getLogger().error({
296
+ message: "LogRocket initialization failed",
297
+ exception: error
298
+ });
299
+ }
300
+ };
301
+ const addListenerWithTimeout = (event) => {
302
+ window.addEventListener(event, handler, { once: true });
303
+ setTimeout(() => {
304
+ if (!handled) {
305
+ getLogger().warn(
306
+ `OneTrust event '${event}' not received within 10s, initializing LogRocket with current consent state`
307
+ );
308
+ handler();
309
+ }
310
+ }, 1e4);
264
311
  };
265
- if (!hasSeenBanner()) {
266
- window.addEventListener("OTConsentApplied", handler, { once: true });
312
+ if (hasSeenBanner()) {
313
+ addListenerWithTimeout("OneTrustGroupsUpdated");
314
+ } else if (getActiveConsentGroups().includes("C0002")) {
315
+ handler();
267
316
  } else {
268
- window.addEventListener("OneTrustGroupsUpdated", handler, { once: true });
317
+ addListenerWithTimeout("OTConsentApplied");
269
318
  }
270
319
  } else {
271
320
  setTimeout(() => {
272
321
  try {
273
322
  init(options);
274
323
  } catch (error) {
324
+ window.emui.isLogRocketInitialized = false;
275
325
  getLogger().error({
276
326
  message: "LogRocket initialization failed",
277
327
  exception: error
@@ -17,10 +17,10 @@ if (!scriptSrc) {
17
17
  } catch {
18
18
  }
19
19
  }
20
- if (scriptSrc && /(cdn\.mortgagetech\..*\.ice\.com|localhost)/.test(scriptSrc)) {
20
+ if (scriptSrc && /(cdn\.mortgagetech\..*\.ice\.com|\/\/localhost[\d:/])/.test(scriptSrc)) {
21
21
  try {
22
22
  const url = new URL(scriptSrc);
23
- cdnDomain = url.origin.includes("localhost") ? "https://cdn.mortgagetech.d1.ice.com" : url.origin;
23
+ cdnDomain = url.hostname === "localhost" ? "https://cdn.mortgagetech.d1.ice.com" : url.origin;
24
24
  } catch {
25
25
  cdnDomain = null;
26
26
  }
@@ -52,7 +52,30 @@ const getParentDomain = () => {
52
52
  };
53
53
  const removeCurrentWindowDomain = (domains) => {
54
54
  if (!domains || domains.length === 0) return null;
55
- return domains.filter((domain) => domain !== window.location.origin);
55
+ const filtered = domains.filter(
56
+ (domain) => domain !== window.location.origin
57
+ );
58
+ return filtered.length > 0 ? filtered : null;
59
+ };
60
+ const ALLOWED_ROOT_HOSTNAMES = [
61
+ ".ice.com",
62
+ ".elliemae.com",
63
+ ".encompassloconnect.com",
64
+ ".ellielabs.com",
65
+ ".elliemae.io",
66
+ ".intcx.net"
67
+ ];
68
+ const getRootHostname = () => {
69
+ let hostname;
70
+ try {
71
+ hostname = window.top?.location?.hostname ?? window.location.hostname;
72
+ } catch {
73
+ hostname = window.location.hostname;
74
+ }
75
+ const parts = hostname.split(".");
76
+ if (parts.length < 2) return null;
77
+ const rootDomain = `.${parts.slice(-2).join(".")}`;
78
+ return ALLOWED_ROOT_HOSTNAMES.includes(rootDomain) ? rootDomain : null;
56
79
  };
57
80
  const getDefaultOptions = () => {
58
81
  const filteredChildDomains = removeCurrentWindowDomain(
@@ -63,7 +86,10 @@ const getDefaultOptions = () => {
63
86
  browser: {
64
87
  urlSanitizer: (url) => {
65
88
  let sanitizedUrl = url;
66
- sanitizedUrl = sanitizedUrl.replace(/code=([^&]*)/, "code=REDACTED");
89
+ sanitizedUrl = sanitizedUrl.replace(
90
+ /([?&])code=([^&]*)/g,
91
+ "$1code=REDACTED"
92
+ );
67
93
  return sanitizedUrl;
68
94
  }
69
95
  },
@@ -84,12 +110,13 @@ const getDefaultOptions = () => {
84
110
  mergeIframes: true,
85
111
  network: {
86
112
  requestSanitizer: (request) => {
87
- const sanitizedRequest = { ...request };
88
- if (request.headers.Authorization) {
89
- sanitizedRequest.headers.Authorization = "**redacted**";
90
- }
113
+ const sanitizedHeaders = Object.keys(request.headers).reduce((acc, key) => {
114
+ acc[key] = /^authorization$/i.test(key) ? "**redacted**" : request.headers[key] ?? "";
115
+ return acc;
116
+ }, {});
91
117
  return {
92
- ...sanitizedRequest,
118
+ ...request,
119
+ headers: sanitizedHeaders,
93
120
  body: null
94
121
  };
95
122
  },
@@ -105,14 +132,15 @@ const getDefaultOptions = () => {
105
132
  },
106
133
  release: process?.env?.APP_VERSION,
107
134
  // app sdk based applications use this env variable to specify the app code version
108
- rootHostname: window.emui?.logRocketConfig?.rootHostname ?? ".ice.com",
135
+ rootHostname: window.emui?.logRocketConfig?.rootHostname ?? getRootHostname() ?? void 0,
109
136
  ...filteredChildDomains && filteredChildDomains.length > 0 ? { childDomains: filteredChildDomains } : {},
110
137
  ...parentDomain ? { parentDomain } : {}
111
138
  };
112
139
  };
140
+ const getActiveConsentGroups = () => window.OnetrustActiveGroups?.split(",").map((g) => g.trim()).filter(Boolean) ?? [];
113
141
  const hasUserConsentedForLogRocketInit = () => {
114
142
  if (window.OnetrustActiveGroups) {
115
- return window.OnetrustActiveGroups.includes("C0002");
143
+ return getActiveConsentGroups().includes("C0002");
116
144
  }
117
145
  return true;
118
146
  };
@@ -127,15 +155,6 @@ const isLogRocketDisabled = () => {
127
155
  if (window.emui?.logRocketConfig?.enable === false || urlParams.get("lrEnabled") === "false") {
128
156
  return true;
129
157
  }
130
- if (window.frameElement) {
131
- try {
132
- const frameUrl = new URL(window.frameElement.src);
133
- if (frameUrl.searchParams.get("lrEnabled") === "false") {
134
- return true;
135
- }
136
- } catch {
137
- }
138
- }
139
158
  return false;
140
159
  };
141
160
  const hasUserConsentedToSessionRecording = () => {
@@ -146,7 +165,7 @@ const hasUserConsentedToSessionRecording = () => {
146
165
  return window.emui.dangerouslyOverrideSessionRecordingConsent;
147
166
  }
148
167
  if (window.OnetrustActiveGroups) {
149
- return window.OnetrustActiveGroups.includes("C0003");
168
+ return getActiveConsentGroups().includes("C0003");
150
169
  }
151
170
  const urlParams = new URLSearchParams(window.location.search);
152
171
  if (urlParams.get("analyticsConsent") === "true") {
@@ -171,11 +190,10 @@ const getLRAppId = (appId) => {
171
190
  };
172
191
  const buildLogRocketQueryParams = () => {
173
192
  const urlParams = new URLSearchParams();
174
- urlParams.append(
175
- "analyticsConsent",
176
- hasUserConsentedToSessionRecording() === true ? "true" : "false"
177
- );
178
- urlParams.append("lrEnabled", isLogRocketDisabled() ? "false" : "true");
193
+ const consent = window.emui?.lrSessionRecordingConsent ?? hasUserConsentedToSessionRecording();
194
+ const enabled = window.emui?.lrEnabled ?? !isLogRocketDisabled();
195
+ urlParams.append("analyticsConsent", consent ? "true" : "false");
196
+ urlParams.append("lrEnabled", enabled ? "true" : "false");
179
197
  urlParams.append("lrAppId", getLRAppId() ?? "");
180
198
  return urlParams.toString();
181
199
  };
@@ -189,11 +207,14 @@ const init = (options) => {
189
207
  }
190
208
  if (isLogRocketDisabled()) {
191
209
  window.emui.isLogRocketInitialized = false;
210
+ window.emui.lrEnabled = false;
192
211
  getLogger().info("LogRocket is disabled in this environment");
193
212
  return;
194
213
  }
214
+ window.emui.lrEnabled = true;
195
215
  const defaultOptions = getDefaultOptions();
196
216
  const consent = hasUserConsentedToSessionRecording();
217
+ window.emui.lrSessionRecordingConsent = consent;
197
218
  if (defaultOptions.dom) {
198
219
  defaultOptions.dom.isEnabled = consent;
199
220
  }
@@ -211,31 +232,60 @@ const init = (options) => {
211
232
  };
212
233
  const hasSeenBanner = () => {
213
234
  const m = document.cookie.match(/(^|;\s*)OptanonAlertBoxClosed=([^;]+)/);
214
- return m ? !!decodeURIComponent(m[2]) : false;
235
+ if (!m) return false;
236
+ try {
237
+ return !!decodeURIComponent(m[2]);
238
+ } catch {
239
+ return false;
240
+ }
215
241
  };
216
242
  const initLogRocket = (options) => {
217
243
  if (window.emui.isLogRocketInitialized) return;
218
- lrAppId = getLRAppId(options?.appId);
219
- if (!lrAppId) {
244
+ if (!getLRAppId(options?.appId)) {
220
245
  throw new Error(
221
246
  "LogRocket appId is required to initialize LogRocket. Either pass it as parameter or set window.emui.logRocketConfig.appId"
222
247
  );
223
248
  }
224
249
  window.emui.isLogRocketInitialized = true;
225
250
  if (window.hasOneTrust) {
251
+ let handled = false;
226
252
  const handler = () => {
227
- init(options);
253
+ if (handled) return;
254
+ handled = true;
255
+ try {
256
+ init(options);
257
+ } catch (error) {
258
+ window.emui.isLogRocketInitialized = false;
259
+ getLogger().error({
260
+ message: "LogRocket initialization failed",
261
+ exception: error
262
+ });
263
+ }
264
+ };
265
+ const addListenerWithTimeout = (event) => {
266
+ window.addEventListener(event, handler, { once: true });
267
+ setTimeout(() => {
268
+ if (!handled) {
269
+ getLogger().warn(
270
+ `OneTrust event '${event}' not received within 10s, initializing LogRocket with current consent state`
271
+ );
272
+ handler();
273
+ }
274
+ }, 1e4);
228
275
  };
229
- if (!hasSeenBanner()) {
230
- window.addEventListener("OTConsentApplied", handler, { once: true });
276
+ if (hasSeenBanner()) {
277
+ addListenerWithTimeout("OneTrustGroupsUpdated");
278
+ } else if (getActiveConsentGroups().includes("C0002")) {
279
+ handler();
231
280
  } else {
232
- window.addEventListener("OneTrustGroupsUpdated", handler, { once: true });
281
+ addListenerWithTimeout("OTConsentApplied");
233
282
  }
234
283
  } else {
235
284
  setTimeout(() => {
236
285
  try {
237
286
  init(options);
238
287
  } catch (error) {
288
+ window.emui.isLogRocketInitialized = false;
239
289
  getLogger().error({
240
290
  message: "LogRocket initialization failed",
241
291
  exception: error
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>LogRocket Test</title><script defer="defer" src="js/emuiLogrocket.6d5dc70c5627242e25d5.js"></script></head><body><h1>LogRocket Test</h1><button id="testButton">Click me</button></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>LogRocket Test</title><script defer="defer" src="js/emuiLogrocket.436f95cb9c84877fed75.js"></script></head><body><h1>LogRocket Test</h1><button id="testButton">Click me</button></body></html>