@aj-2000-test/goodlogs-sdk 0.3.4 → 0.3.6

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.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var S=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var I={us:"https://goodlogs-api-us.happyhill-a7c56143.centralindia.azurecontainerapps.io",eu:"https://goodlogs-api-eu.yellowmeadow-422296f6.japaneast.azurecontainerapps.io",ap:"https://goodlogs-api-ap.delightfulsand-90b72c09.southeastasia.azurecontainerapps.io"};function B(o){let t=o.split("_");return t.length>=4&&t[0]==="gl"?t[2]:"eu"}function y(o,t){if(t)return t;let e=B(o);return I[e]||I.eu}var G=5e3,F=50,v="0.3.4",w="gl_anon_id",_="gl_session_id";function b(){return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,o=>{let t=Math.random()*16|0;return (o==="x"?t:t&3|8).toString(16)})}function M(){let o={$goodlogs_sdk:"js",$goodlogs_sdk_version:v};return typeof navigator>"u"||(typeof screen<"u"&&(o.$screen=`${screen.width}x${screen.height}`),typeof navigator<"u"&&(o.$language=navigator.language??""),typeof location<"u"&&(o.$url=location.href,o.$path=location.pathname,o.$page=location.pathname.split("/").filter(Boolean).pop()||"/"),typeof document<"u"&&(document.referrer&&(o.$referrer=document.referrer),document.title&&(o.$title=document.title))),o}function U(o,t){let e={$session_id:o,$distinct_id:t,$goodlogs_sdk:"js",$goodlogs_sdk_version:v};return typeof navigator>"u"||typeof location<"u"&&(e.$url=location.href,e.$path=location.pathname),e}function D(){if(!(typeof document<"u"))try{let t=new Error().stack?.split(`
1
+ 'use strict';var S=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var I={us:"https://goodlogs-api-us.happyhill-a7c56143.centralindia.azurecontainerapps.io",eu:"https://goodlogs-api-eu.yellowmeadow-422296f6.japaneast.azurecontainerapps.io",ap:"https://goodlogs-api-ap.delightfulsand-90b72c09.southeastasia.azurecontainerapps.io"};function B(o){let t=o.split("_");return t.length>=4&&t[0]==="gl"?t[2]:"eu"}function y(o,t){if(t)return t;let e=B(o);return I[e]||I.eu}var G=5e3,F=50,v="0.3.6",w="gl_anon_id",_="gl_session_id";function b(){return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,o=>{let t=Math.random()*16|0;return (o==="x"?t:t&3|8).toString(16)})}function M(){let o={$goodlogs_sdk:"js",$goodlogs_sdk_version:v};return typeof navigator>"u"||(typeof screen<"u"&&(o.$screen=`${screen.width}x${screen.height}`),typeof navigator<"u"&&(o.$language=navigator.language??""),typeof location<"u"&&(o.$url=location.href,o.$path=location.pathname,o.$page=location.pathname.split("/").filter(Boolean).pop()||"/"),typeof document<"u"&&(document.referrer&&(o.$referrer=document.referrer),document.title&&(o.$title=document.title))),o}function U(o,t){let e={$session_id:o,$distinct_id:t,$goodlogs_sdk:"js",$goodlogs_sdk_version:v};return typeof navigator>"u"||typeof location<"u"&&(e.$url=location.href,e.$path=location.pathname),e}function D(){if(!(typeof document<"u"))try{let t=new Error().stack?.split(`
2
2
  `);if(!t)return;for(let e=3;e<Math.min(t.length,8);e++){let n=t[e]?.trim();if(!n||n.includes("goodlogs")&&(n.includes("client.")||n.includes("index.")))continue;let r=n.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):\d+\)?/);if(r){let s=r[1]||"<anonymous>",i=r[2]?.replace(/^.*[/\\]/,"")??"",d=r[3];return `${s}@${i}:${d}`}}}catch{}}function K(){if(typeof localStorage<"u"){let o=localStorage.getItem(w);if(o)return o;let t=b();return localStorage.setItem(w,t),t}return b()}function X(){if(typeof sessionStorage<"u"){let o=sessionStorage.getItem(_);if(o)return o;let t=b();return sessionStorage.setItem(_,t),t}return b()}function z(){let o="";for(let t=0;t<32;t++)o+=(Math.random()*16|0).toString(16);return o}function V(){let o="";for(let t=0;t<16;t++)o+=(Math.random()*16|0).toString(16);return o}function W(o,t){switch(o){case "lcp":return t<=2500?"good":t<=4e3?"needs-improvement":"poor";case "inp":return t<=200?"good":t<=500?"needs-improvement":"poor";case "cls":return t<=.1?"good":t<=.25?"needs-improvement":"poor";case "fcp":return t<=1800?"good":t<=3e3?"needs-improvement":"poor";case "ttfb":return t<=800?"good":t<=1800?"needs-improvement":"poor";default:return}}function J(o){if(!o)return [];let t=[];for(let e of o.split(`
3
3
  `)){let n=e.trim();if(!n||n.startsWith("Error")||n.startsWith("at Error"))continue;let r=/^at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?$/.exec(n);if(r){let s=r[1]?.trim(),i=r[2];t.push({function:s&&s!=="<anonymous>"?s:void 0,filename:i,lineno:Number(r[3]),colno:Number(r[4]),abs_path:i,in_app:!i.includes("node_modules/")&&!i.includes("/dist/")&&!i.startsWith("internal/")});continue}if(r=/^([^@]*)@(.+?):(\d+):(\d+)$/.exec(n),r){let s=r[1]?.trim(),i=r[2];t.push({function:s||void 0,filename:i,lineno:Number(r[3]),colno:Number(r[4]),abs_path:i,in_app:!i.includes("node_modules/")&&!i.includes("/dist/")});}}return t}var R=class R{constructor(t){this.originalFetch=null;this.xhrPatched=false;this.logBuffer=[];this.eventBuffer=[];this.errorBuffer=[];this.vitalBuffer=[];this.spanBuffer=[];this.breadcrumbBuffer=[];this.timer=null;this.visibilityHandler=null;this.clickHandler=null;this.lastPath="";this.navTransaction=null;this.errorHandler=null;this.rejectionHandler=null;this.apiKey=t.apiKey,this.endpoint=y(t.apiKey,t.endpoint).replace(/\/+$/,""),this.flushInterval=t.flushInterval??G,this.batchSize=t.batchSize??F,this.defaultContext=t.defaultContext??{},this.onError=t.onError??(()=>{}),this.disabled=t.disabled??false,this.telemetry=t.telemetry??true,this.useEnvelope=t.useEnvelope??false,this.autoFetch=t.autoFetch??(this.useEnvelope&&t.autocapture!==false),this.anonymousId=K(),this.sessionId=X(),this.disabled&&typeof console<"u"&&console.warn("[GoodLogs] SDK is disabled. No events or logs will be sent."),this.disabled||(this.startTimer(),this.attachPageLifecycle(),t.autocapture!==false&&(this.attachClickCapture(),this.captureWebVitals(),this.attachPageviewCapture(),this.attachGlobalErrorHandlers()),this.autoFetch&&(this.attachFetchInstrumentation(),this.attachXhrInstrumentation()),this.sendTelemetry("init","info"));}log(t,e,n){if(this.disabled)return;let r=65536,s=e;e.length>r&&(s=e.slice(0,r-100)+`
4
4
 
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var S=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var I={us:"https://goodlogs-api-us.happyhill-a7c56143.centralindia.azurecontainerapps.io",eu:"https://goodlogs-api-eu.yellowmeadow-422296f6.japaneast.azurecontainerapps.io",ap:"https://goodlogs-api-ap.delightfulsand-90b72c09.southeastasia.azurecontainerapps.io"};function B(o){let t=o.split("_");return t.length>=4&&t[0]==="gl"?t[2]:"eu"}function y(o,t){if(t)return t;let e=B(o);return I[e]||I.eu}var G=5e3,F=50,v="0.3.4",w="gl_anon_id",_="gl_session_id";function b(){return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,o=>{let t=Math.random()*16|0;return (o==="x"?t:t&3|8).toString(16)})}function M(){let o={$goodlogs_sdk:"js",$goodlogs_sdk_version:v};return typeof navigator>"u"||(typeof screen<"u"&&(o.$screen=`${screen.width}x${screen.height}`),typeof navigator<"u"&&(o.$language=navigator.language??""),typeof location<"u"&&(o.$url=location.href,o.$path=location.pathname,o.$page=location.pathname.split("/").filter(Boolean).pop()||"/"),typeof document<"u"&&(document.referrer&&(o.$referrer=document.referrer),document.title&&(o.$title=document.title))),o}function U(o,t){let e={$session_id:o,$distinct_id:t,$goodlogs_sdk:"js",$goodlogs_sdk_version:v};return typeof navigator>"u"||typeof location<"u"&&(e.$url=location.href,e.$path=location.pathname),e}function D(){if(!(typeof document<"u"))try{let t=new Error().stack?.split(`
1
+ var S=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var I={us:"https://goodlogs-api-us.happyhill-a7c56143.centralindia.azurecontainerapps.io",eu:"https://goodlogs-api-eu.yellowmeadow-422296f6.japaneast.azurecontainerapps.io",ap:"https://goodlogs-api-ap.delightfulsand-90b72c09.southeastasia.azurecontainerapps.io"};function B(o){let t=o.split("_");return t.length>=4&&t[0]==="gl"?t[2]:"eu"}function y(o,t){if(t)return t;let e=B(o);return I[e]||I.eu}var G=5e3,F=50,v="0.3.6",w="gl_anon_id",_="gl_session_id";function b(){return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,o=>{let t=Math.random()*16|0;return (o==="x"?t:t&3|8).toString(16)})}function M(){let o={$goodlogs_sdk:"js",$goodlogs_sdk_version:v};return typeof navigator>"u"||(typeof screen<"u"&&(o.$screen=`${screen.width}x${screen.height}`),typeof navigator<"u"&&(o.$language=navigator.language??""),typeof location<"u"&&(o.$url=location.href,o.$path=location.pathname,o.$page=location.pathname.split("/").filter(Boolean).pop()||"/"),typeof document<"u"&&(document.referrer&&(o.$referrer=document.referrer),document.title&&(o.$title=document.title))),o}function U(o,t){let e={$session_id:o,$distinct_id:t,$goodlogs_sdk:"js",$goodlogs_sdk_version:v};return typeof navigator>"u"||typeof location<"u"&&(e.$url=location.href,e.$path=location.pathname),e}function D(){if(!(typeof document<"u"))try{let t=new Error().stack?.split(`
2
2
  `);if(!t)return;for(let e=3;e<Math.min(t.length,8);e++){let n=t[e]?.trim();if(!n||n.includes("goodlogs")&&(n.includes("client.")||n.includes("index.")))continue;let r=n.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):\d+\)?/);if(r){let s=r[1]||"<anonymous>",i=r[2]?.replace(/^.*[/\\]/,"")??"",d=r[3];return `${s}@${i}:${d}`}}}catch{}}function K(){if(typeof localStorage<"u"){let o=localStorage.getItem(w);if(o)return o;let t=b();return localStorage.setItem(w,t),t}return b()}function X(){if(typeof sessionStorage<"u"){let o=sessionStorage.getItem(_);if(o)return o;let t=b();return sessionStorage.setItem(_,t),t}return b()}function z(){let o="";for(let t=0;t<32;t++)o+=(Math.random()*16|0).toString(16);return o}function V(){let o="";for(let t=0;t<16;t++)o+=(Math.random()*16|0).toString(16);return o}function W(o,t){switch(o){case "lcp":return t<=2500?"good":t<=4e3?"needs-improvement":"poor";case "inp":return t<=200?"good":t<=500?"needs-improvement":"poor";case "cls":return t<=.1?"good":t<=.25?"needs-improvement":"poor";case "fcp":return t<=1800?"good":t<=3e3?"needs-improvement":"poor";case "ttfb":return t<=800?"good":t<=1800?"needs-improvement":"poor";default:return}}function J(o){if(!o)return [];let t=[];for(let e of o.split(`
3
3
  `)){let n=e.trim();if(!n||n.startsWith("Error")||n.startsWith("at Error"))continue;let r=/^at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?$/.exec(n);if(r){let s=r[1]?.trim(),i=r[2];t.push({function:s&&s!=="<anonymous>"?s:void 0,filename:i,lineno:Number(r[3]),colno:Number(r[4]),abs_path:i,in_app:!i.includes("node_modules/")&&!i.includes("/dist/")&&!i.startsWith("internal/")});continue}if(r=/^([^@]*)@(.+?):(\d+):(\d+)$/.exec(n),r){let s=r[1]?.trim(),i=r[2];t.push({function:s||void 0,filename:i,lineno:Number(r[3]),colno:Number(r[4]),abs_path:i,in_app:!i.includes("node_modules/")&&!i.includes("/dist/")});}}return t}var R=class R{constructor(t){this.originalFetch=null;this.xhrPatched=false;this.logBuffer=[];this.eventBuffer=[];this.errorBuffer=[];this.vitalBuffer=[];this.spanBuffer=[];this.breadcrumbBuffer=[];this.timer=null;this.visibilityHandler=null;this.clickHandler=null;this.lastPath="";this.navTransaction=null;this.errorHandler=null;this.rejectionHandler=null;this.apiKey=t.apiKey,this.endpoint=y(t.apiKey,t.endpoint).replace(/\/+$/,""),this.flushInterval=t.flushInterval??G,this.batchSize=t.batchSize??F,this.defaultContext=t.defaultContext??{},this.onError=t.onError??(()=>{}),this.disabled=t.disabled??false,this.telemetry=t.telemetry??true,this.useEnvelope=t.useEnvelope??false,this.autoFetch=t.autoFetch??(this.useEnvelope&&t.autocapture!==false),this.anonymousId=K(),this.sessionId=X(),this.disabled&&typeof console<"u"&&console.warn("[GoodLogs] SDK is disabled. No events or logs will be sent."),this.disabled||(this.startTimer(),this.attachPageLifecycle(),t.autocapture!==false&&(this.attachClickCapture(),this.captureWebVitals(),this.attachPageviewCapture(),this.attachGlobalErrorHandlers()),this.autoFetch&&(this.attachFetchInstrumentation(),this.attachXhrInstrumentation()),this.sendTelemetry("init","info"));}log(t,e,n){if(this.disabled)return;let r=65536,s=e;e.length>r&&(s=e.slice(0,r-100)+`
4
4
 
package/dist/react.cjs ADDED
@@ -0,0 +1 @@
1
+ 'use strict';var react=require('react');var r=null,i=[],l=null,p=5e3,g=200,h=1;function c(){l||(l=setInterval(d,p),typeof window<"u"&&window.addEventListener("beforeunload",()=>d()));}function d(){if(!r||i.length===0)return;let e=i;i=[];let t=r.endpoint,n=r.apiKey;try{fetch(`${t}/v1/profiles/renders`,{method:"POST",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"},body:JSON.stringify({batch:e}),keepalive:!0}).catch(()=>{});}catch{}}function y(){return typeof window>"u"?null:window.location?.pathname??null}function m(e){return (t,n,o,s,b,f)=>{o<h||(i.push({component:e||t,phase:n,actual_ms:Math.round(o*100)/100,base_ms:Math.round(s*100)/100,commit_time:Math.round(f*100)/100,route:y(),timestamp:new Date().toISOString()}),i.length>=g&&d());}}function R(e){r=e,c();}function P({gl:e,id:t,children:n}){return e&&!r&&(r=e,c()),react.createElement(react.Profiler,{id:t,onRender:m(t)},n)}function _(e,t){let n=t||e.displayName||e.name||"Unknown",o=s=>react.createElement(react.Profiler,{id:n,onRender:m(n)},react.createElement(e,s));return o.displayName=`withProfiler(${n})`,o}exports.GoodLogsProfiler=P;exports.initReactProfiler=R;exports.withProfiler=_;
@@ -0,0 +1,52 @@
1
+ import { ReactNode, ComponentType, FC } from 'react';
2
+ import { G as GoodLogs } from './client-w3t1Yzjd.cjs';
3
+
4
+ /**
5
+ * React Profiler Integration — component render timing.
6
+ *
7
+ * Usage:
8
+ * import { GoodLogsProfiler, withProfiler } from "@aj-2000-test/goodlogs-sdk/react"
9
+ *
10
+ * // Option 1: Wrap individual components
11
+ * const ProfiledApp = withProfiler(App, "App")
12
+ *
13
+ * // Option 2: Use the Profiler component directly
14
+ * <GoodLogsProfiler gl={gl} id="Checkout">
15
+ * <CheckoutForm />
16
+ * </GoodLogsProfiler>
17
+ *
18
+ * Works in ALL browsers, ALL React versions 16.5+, in production builds.
19
+ * Captures component render times (actual + base), phase (mount/update),
20
+ * and ships them to POST /v1/profiles/renders.
21
+ */
22
+
23
+ /**
24
+ * Initialize the React profiler with a GoodLogs instance.
25
+ * Call once at app startup before rendering any profiled components.
26
+ */
27
+ declare function initReactProfiler(gl: GoodLogs): void;
28
+ /**
29
+ * React Profiler wrapper component. Wraps children in React.Profiler
30
+ * and reports render timings to GoodLogs.
31
+ *
32
+ * ```tsx
33
+ * <GoodLogsProfiler gl={gl} id="Checkout">
34
+ * <CheckoutForm />
35
+ * </GoodLogsProfiler>
36
+ * ```
37
+ */
38
+ declare function GoodLogsProfiler({ gl, id, children, }: {
39
+ gl?: GoodLogs;
40
+ id: string;
41
+ children: ReactNode;
42
+ }): ReactNode;
43
+ /**
44
+ * HOC: wraps a component with React.Profiler.
45
+ *
46
+ * ```tsx
47
+ * const ProfiledApp = withProfiler(App, "App")
48
+ * ```
49
+ */
50
+ declare function withProfiler<P extends Record<string, unknown>>(Component: ComponentType<P>, displayName?: string): FC<P>;
51
+
52
+ export { GoodLogsProfiler, initReactProfiler, withProfiler };
@@ -0,0 +1,52 @@
1
+ import { ReactNode, ComponentType, FC } from 'react';
2
+ import { G as GoodLogs } from './client-w3t1Yzjd.js';
3
+
4
+ /**
5
+ * React Profiler Integration — component render timing.
6
+ *
7
+ * Usage:
8
+ * import { GoodLogsProfiler, withProfiler } from "@aj-2000-test/goodlogs-sdk/react"
9
+ *
10
+ * // Option 1: Wrap individual components
11
+ * const ProfiledApp = withProfiler(App, "App")
12
+ *
13
+ * // Option 2: Use the Profiler component directly
14
+ * <GoodLogsProfiler gl={gl} id="Checkout">
15
+ * <CheckoutForm />
16
+ * </GoodLogsProfiler>
17
+ *
18
+ * Works in ALL browsers, ALL React versions 16.5+, in production builds.
19
+ * Captures component render times (actual + base), phase (mount/update),
20
+ * and ships them to POST /v1/profiles/renders.
21
+ */
22
+
23
+ /**
24
+ * Initialize the React profiler with a GoodLogs instance.
25
+ * Call once at app startup before rendering any profiled components.
26
+ */
27
+ declare function initReactProfiler(gl: GoodLogs): void;
28
+ /**
29
+ * React Profiler wrapper component. Wraps children in React.Profiler
30
+ * and reports render timings to GoodLogs.
31
+ *
32
+ * ```tsx
33
+ * <GoodLogsProfiler gl={gl} id="Checkout">
34
+ * <CheckoutForm />
35
+ * </GoodLogsProfiler>
36
+ * ```
37
+ */
38
+ declare function GoodLogsProfiler({ gl, id, children, }: {
39
+ gl?: GoodLogs;
40
+ id: string;
41
+ children: ReactNode;
42
+ }): ReactNode;
43
+ /**
44
+ * HOC: wraps a component with React.Profiler.
45
+ *
46
+ * ```tsx
47
+ * const ProfiledApp = withProfiler(App, "App")
48
+ * ```
49
+ */
50
+ declare function withProfiler<P extends Record<string, unknown>>(Component: ComponentType<P>, displayName?: string): FC<P>;
51
+
52
+ export { GoodLogsProfiler, initReactProfiler, withProfiler };
package/dist/react.js ADDED
@@ -0,0 +1 @@
1
+ import {createElement,Profiler}from'react';var r=null,i=[],l=null,p=5e3,g=200,h=1;function c(){l||(l=setInterval(d,p),typeof window<"u"&&window.addEventListener("beforeunload",()=>d()));}function d(){if(!r||i.length===0)return;let e=i;i=[];let t=r.endpoint,n=r.apiKey;try{fetch(`${t}/v1/profiles/renders`,{method:"POST",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"},body:JSON.stringify({batch:e}),keepalive:!0}).catch(()=>{});}catch{}}function y(){return typeof window>"u"?null:window.location?.pathname??null}function m(e){return (t,n,o,s,b,f)=>{o<h||(i.push({component:e||t,phase:n,actual_ms:Math.round(o*100)/100,base_ms:Math.round(s*100)/100,commit_time:Math.round(f*100)/100,route:y(),timestamp:new Date().toISOString()}),i.length>=g&&d());}}function R(e){r=e,c();}function P({gl:e,id:t,children:n}){return e&&!r&&(r=e,c()),createElement(Profiler,{id:t,onRender:m(t)},n)}function _(e,t){let n=t||e.displayName||e.name||"Unknown",o=s=>createElement(Profiler,{id:n,onRender:m(n)},createElement(e,s));return o.displayName=`withProfiler(${n})`,o}export{P as GoodLogsProfiler,R as initReactProfiler,_ as withProfiler};
package/dist/replay.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var S=new Set([1,3,6]);function G(n){return n.every(e=>{if(e.type!==3)return false;let o=e.data?.source;return o!==void 0&&S.has(o)})}var m=null;async function N(n,e={}){if(typeof document>"u")return null;if(m)return m;let o=e.sampleRate??1;if(o<1&&Math.random()>o)return null;let a=e.rrwebRecord??await H();if(!a)return null;let r=n.endpoint,l=n.apiKey,i=n.sessionId,R=n.getDistinctId(),I=e.flushIntervalMs??5e3,E=e.flushBytes??5e5,T=e.sessionTimeoutMs??1800*1e3,B=e.maxSessionMs??3600*1e3,d=[],f=0,C=0,b=false,p=false,g=Date.now(),O=Date.now();u(r,l,{session_id:i,distinct_id:R,start_url:typeof location<"u"?location.href:null,last_url:typeof location<"u"?location.href:null},e.onError);let c=async(t=false)=>{if(d.length===0)return;if(!t&&G(d)){d=[],f=0;return}let s=d,M=s[0].timestamp,_=s[s.length-1].timestamp,P=s.length;d=[],f=0;let $=C++;try{let w=JSON.stringify(s),z=await q(w),U=`${r}/v1/replay/chunks?session_id=${encodeURIComponent(i)}&seq=${$}&start_ts=${encodeURIComponent(new Date(M).toISOString())}&end_ts=${encodeURIComponent(new Date(_).toISOString())}&event_count=${P}`;await fetch(U,{method:"POST",headers:{Authorization:`Bearer ${l}`,"Content-Type":"application/gzip","Content-Encoding":"gzip"},body:z,keepalive:!0});}catch(w){e.onError?.(w);}u(r,l,{session_id:i,last_url:typeof location<"u"?location.href:null,last_activity_at:new Date(_).toISOString(),has_error:b||void 0},e.onError);},x=setInterval(()=>{globalThis.__gl_replay_has_error__&&(b=true);},1e3),v=t=>{if(!p){p=true,clearInterval(A),clearInterval(L),clearInterval(x),document?.removeEventListener("visibilitychange",y),typeof window<"u"&&window.removeEventListener("beforeunload",h);try{D();}catch(s){e.onError?.(s);}c(true),u(r,l,{session_id:i,ended_at:new Date().toISOString()},e.onError),m=null;}},D=a({emit:t=>{if(p)return;t.type===3&&S.has(t.data?.source??-1)||(g=Date.now()),d.push(t),f+=256,f>=E&&c();},checkoutEveryNms:6e4,maskAllInputs:e.maskAllInputs??true,blockSelector:e.blockSelector??"[data-gl-block]",maskTextSelector:e.maskTextSelector??"[data-gl-mask]",sampling:{mousemove:50,mouseInteraction:true,scroll:150,input:"last"}}),A=setInterval(()=>{c();},I),L=setInterval(()=>{let t=Date.now();if(t-g>T){v();return}if(t-O>B){v();return}},1e4),y=()=>{document?.visibilityState==="hidden"&&(c(true),u(r,l,{session_id:i,ended_at:new Date().toISOString()},e.onError));};document.addEventListener("visibilitychange",y);let h=()=>{c(true),u(r,l,{session_id:i,ended_at:new Date().toISOString()},e.onError);};typeof window<"u"&&window.addEventListener("beforeunload",h);let k={sessionId:i,flush:()=>c(true),stop:()=>v()};return m=k,k}async function u(n,e,o,a){try{await fetch(`${n}/v1/replay/sessions`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(o),keepalive:!0});}catch(r){a?.(r);}}async function q(n){if(typeof CompressionStream>"u"||typeof Blob>"u"||typeof Response>"u")return n;let o=new Blob([n]).stream().pipeThrough(new CompressionStream("gzip")),a=await new Response(o).arrayBuffer();return new Blob([a],{type:"application/gzip"})}async function H(){try{let n=await import('rrweb');return n.record??n.default?.record??null}catch{return null}}exports.startReplay=N;
1
+ 'use strict';var O=new Set([1,3,6]);function j(t){return t.every(e=>{if(e.type!==3)return false;let o=e.data?.source;return o!==void 0&&O.has(o)})}var w=null;async function V(t,e={}){if(typeof document>"u")return null;if(w)return w;let o=e.sampleRate??1;if(o<1&&Math.random()>o)return null;let i=e.rrwebRecord??await J();if(!i)return null;let r=t.endpoint,a=t.apiKey,p=t,C=e.flushIntervalMs??5e3,M=e.flushBytes??5e5,S=e.sessionTimeoutMs??1800*1e3,L=e.maxSessionMs??3600*1e3,s=p.sessionId,l=[],v=0,x=0,g=false,u=false,f=Date.now(),k=Date.now(),y=null,I=()=>{m(r,a,{session_id:s,distinct_id:p.getDistinctId(),start_url:typeof location<"u"?location.href:null,last_url:typeof location<"u"?location.href:null},e.onError);},R=()=>{d(true),m(r,a,{session_id:s,ended_at:new Date().toISOString()},e.onError);},d=async(n=false)=>{if(l.length===0)return;if(!n&&j(l)){l=[],v=0;return}let c=l,U=c[0].timestamp,D=c[c.length-1].timestamp,G=c.length;l=[],v=0;let q=x++;try{let h=JSON.stringify(c),H=await K(h),N=`${r}/v1/replay/chunks?session_id=${encodeURIComponent(s)}&seq=${q}&start_ts=${encodeURIComponent(new Date(U).toISOString())}&end_ts=${encodeURIComponent(new Date(D).toISOString())}&event_count=${G}`;await fetch(N,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/gzip","Content-Encoding":"gzip"},body:H,keepalive:!0});}catch(h){e.onError?.(h);}m(r,a,{session_id:s,last_url:typeof location<"u"?location.href:null,last_activity_at:new Date(D).toISOString(),has_error:g||void 0},e.onError);},b=()=>{R();try{y?.();}catch(n){e.onError?.(n);}p.newSession(),s=p.getSessionId(),x=0,g=false,f=Date.now(),k=Date.now(),I(),_();},_=()=>{y=i({emit:n=>{if(u)return;n.type===3&&O.has(n.data?.source??-1)||(f=Date.now()),l.push(n),v+=256,v>=M&&d();},checkoutEveryNms:6e4,maskAllInputs:e.maskAllInputs??true,blockSelector:e.blockSelector??"[data-gl-block]",maskTextSelector:e.maskTextSelector??"[data-gl-mask]",sampling:{mousemove:50,mouseInteraction:true,scroll:150,input:"last"}});},A=setInterval(()=>{globalThis.__gl_replay_has_error__&&(g=true);},1e3),P=()=>{if(!u){u=true,clearInterval($),clearInterval(z),clearInterval(A),document?.removeEventListener("visibilitychange",E),typeof window<"u"&&window.removeEventListener("beforeunload",T);try{y?.();}catch(n){e.onError?.(n);}R(),w=null;}};I(),_();let $=setInterval(()=>{d();},C),z=setInterval(()=>{if(u)return;let n=Date.now();if(n-f>S){b();return}if(n-k>L){b();return}},1e4),E=()=>{u||(document?.visibilityState==="hidden"?(d(true),m(r,a,{session_id:s,ended_at:new Date().toISOString()},e.onError)):document?.visibilityState==="visible"&&(Date.now()-f>S?b():f=Date.now()));};document.addEventListener("visibilitychange",E);let T=()=>{d(true),m(r,a,{session_id:s,ended_at:new Date().toISOString()},e.onError);};typeof window<"u"&&window.addEventListener("beforeunload",T);let B={get sessionId(){return s},flush:()=>d(true),stop:P};return w=B,B}async function m(t,e,o,i){try{await fetch(`${t}/v1/replay/sessions`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(o),keepalive:!0});}catch(r){i?.(r);}}async function K(t){if(typeof CompressionStream>"u"||typeof Blob>"u"||typeof Response>"u")return t;let o=new Blob([t]).stream().pipeThrough(new CompressionStream("gzip")),i=await new Response(o).arrayBuffer();return new Blob([i],{type:"application/gzip"})}async function J(){try{let t=await import('rrweb');return t.record??t.default?.record??null}catch{return null}}exports.startReplay=V;
package/dist/replay.d.cts CHANGED
@@ -3,17 +3,22 @@ import { G as GoodLogs } from './client-w3t1Yzjd.cjs';
3
3
  /**
4
4
  * Session Replay (rrweb) — optional, tree-split.
5
5
  *
6
- * Industry-standard behaviours (Sentry/PostHog parity):
7
- * 1. 30-min inactivity timeout → seals session, new ID on resume.
8
- * 2. Idle suppression: if the queue contains only mouse-move / scroll
9
- * events and nothing visual changed, skip the flush entirely.
10
- * 3. Auto-end on visibilitychange=hidden + beforeunload (keepalive).
11
- * 4. Dedup guard: calling startReplay() twice is a no-op.
12
- * 5. Max session duration: 60 min hard cap auto-stop.
13
- * 6. rrweb sampling: mouse movement 50ms, scroll 150ms to cut volume.
6
+ * Industry-standard session lifecycle (PostHog/Sentry parity):
7
+ * 1. 30-min inactivity timeout → seals session, auto-starts a NEW
8
+ * session on next user activity (session rotation).
9
+ * 2. 60-min hard cap same rotation behaviour.
10
+ * 3. Tab hide (visibilitychange=hidden) → flush + seal. Tab show →
11
+ * resume with a NEW session if timeout elapsed, else continue.
12
+ * 4. Idle suppression: flush with only mousemove/scroll/touch is dropped.
13
+ * 5. Dedup guard: calling startReplay() twice returns existing handle.
14
+ * 6. rrweb sampling: mousemove 50ms, scroll 150ms, input 'last'.
15
+ *
16
+ * Sessions are linked by distinct_id (user identity) so the dashboard
17
+ * can show all sessions for a user. Each session is a separate playable
18
+ * recording bounded to ≤60 min.
14
19
  *
15
20
  * rrweb is a real npm peer dep, dynamically imported so the core SDK
16
- * bundle stays small and the rrweb code only loads when replay is started.
21
+ * bundle stays small.
17
22
  */
18
23
 
19
24
  interface RrwebRecord {
@@ -21,11 +26,7 @@ interface RrwebRecord {
21
26
  emit: (event: RrwebEvent, isCheckout?: boolean) => void;
22
27
  checkoutEveryNms?: number;
23
28
  maskAllInputs?: boolean;
24
- maskInputOptions?: Record<string, boolean>;
25
- blockClass?: string;
26
29
  blockSelector?: string;
27
- ignoreClass?: string;
28
- maskTextClass?: string;
29
30
  maskTextSelector?: string;
30
31
  sampling?: Record<string, unknown>;
31
32
  }): () => void;
@@ -36,36 +37,25 @@ interface RrwebEvent {
36
37
  timestamp: number;
37
38
  }
38
39
  interface ReplayOptions {
39
- /** Provide rrweb `record` yourself (bundled). Skips dynamic import. */
40
40
  rrwebRecord?: RrwebRecord;
41
- /** Flush interval ms (default 5000). */
42
41
  flushIntervalMs?: number;
43
- /** Flush when queue reaches this byte estimate (default 500_000). */
44
42
  flushBytes?: number;
45
- /** Sample rate 0..1 (default 1). */
46
43
  sampleRate?: number;
47
- /** Block elements matching this CSS selector. */
48
44
  blockSelector?: string;
49
- /** Mask text in elements matching this selector. */
50
45
  maskTextSelector?: string;
51
- /** Mask all inputs/textareas (default true). */
52
46
  maskAllInputs?: boolean;
53
- /** Inactivity timeout ms before session auto-seals (default 30 min). */
47
+ /** Inactivity timeout before session rotation (default 30 min). */
54
48
  sessionTimeoutMs?: number;
55
- /** Hard cap session length ms (default 60 min). */
49
+ /** Max session duration before rotation (default 60 min). */
56
50
  maxSessionMs?: number;
57
- /** Error callback. */
58
51
  onError?: (e: unknown) => void;
59
52
  }
60
53
  interface ReplayHandle {
61
54
  stop: () => void;
62
55
  flush: () => Promise<void>;
63
- sessionId: string;
56
+ /** Current session_id (changes on rotation). */
57
+ readonly sessionId: string;
64
58
  }
65
- /**
66
- * Start recording. Returns a handle with `stop()` and `flush()`.
67
- * Second call is a no-op — returns the existing handle.
68
- */
69
59
  declare function startReplay(gl: GoodLogs, options?: ReplayOptions): Promise<ReplayHandle | null>;
70
60
 
71
61
  export { type ReplayHandle, type ReplayOptions, type RrwebEvent, startReplay };
package/dist/replay.d.ts CHANGED
@@ -3,17 +3,22 @@ import { G as GoodLogs } from './client-w3t1Yzjd.js';
3
3
  /**
4
4
  * Session Replay (rrweb) — optional, tree-split.
5
5
  *
6
- * Industry-standard behaviours (Sentry/PostHog parity):
7
- * 1. 30-min inactivity timeout → seals session, new ID on resume.
8
- * 2. Idle suppression: if the queue contains only mouse-move / scroll
9
- * events and nothing visual changed, skip the flush entirely.
10
- * 3. Auto-end on visibilitychange=hidden + beforeunload (keepalive).
11
- * 4. Dedup guard: calling startReplay() twice is a no-op.
12
- * 5. Max session duration: 60 min hard cap auto-stop.
13
- * 6. rrweb sampling: mouse movement 50ms, scroll 150ms to cut volume.
6
+ * Industry-standard session lifecycle (PostHog/Sentry parity):
7
+ * 1. 30-min inactivity timeout → seals session, auto-starts a NEW
8
+ * session on next user activity (session rotation).
9
+ * 2. 60-min hard cap same rotation behaviour.
10
+ * 3. Tab hide (visibilitychange=hidden) → flush + seal. Tab show →
11
+ * resume with a NEW session if timeout elapsed, else continue.
12
+ * 4. Idle suppression: flush with only mousemove/scroll/touch is dropped.
13
+ * 5. Dedup guard: calling startReplay() twice returns existing handle.
14
+ * 6. rrweb sampling: mousemove 50ms, scroll 150ms, input 'last'.
15
+ *
16
+ * Sessions are linked by distinct_id (user identity) so the dashboard
17
+ * can show all sessions for a user. Each session is a separate playable
18
+ * recording bounded to ≤60 min.
14
19
  *
15
20
  * rrweb is a real npm peer dep, dynamically imported so the core SDK
16
- * bundle stays small and the rrweb code only loads when replay is started.
21
+ * bundle stays small.
17
22
  */
18
23
 
19
24
  interface RrwebRecord {
@@ -21,11 +26,7 @@ interface RrwebRecord {
21
26
  emit: (event: RrwebEvent, isCheckout?: boolean) => void;
22
27
  checkoutEveryNms?: number;
23
28
  maskAllInputs?: boolean;
24
- maskInputOptions?: Record<string, boolean>;
25
- blockClass?: string;
26
29
  blockSelector?: string;
27
- ignoreClass?: string;
28
- maskTextClass?: string;
29
30
  maskTextSelector?: string;
30
31
  sampling?: Record<string, unknown>;
31
32
  }): () => void;
@@ -36,36 +37,25 @@ interface RrwebEvent {
36
37
  timestamp: number;
37
38
  }
38
39
  interface ReplayOptions {
39
- /** Provide rrweb `record` yourself (bundled). Skips dynamic import. */
40
40
  rrwebRecord?: RrwebRecord;
41
- /** Flush interval ms (default 5000). */
42
41
  flushIntervalMs?: number;
43
- /** Flush when queue reaches this byte estimate (default 500_000). */
44
42
  flushBytes?: number;
45
- /** Sample rate 0..1 (default 1). */
46
43
  sampleRate?: number;
47
- /** Block elements matching this CSS selector. */
48
44
  blockSelector?: string;
49
- /** Mask text in elements matching this selector. */
50
45
  maskTextSelector?: string;
51
- /** Mask all inputs/textareas (default true). */
52
46
  maskAllInputs?: boolean;
53
- /** Inactivity timeout ms before session auto-seals (default 30 min). */
47
+ /** Inactivity timeout before session rotation (default 30 min). */
54
48
  sessionTimeoutMs?: number;
55
- /** Hard cap session length ms (default 60 min). */
49
+ /** Max session duration before rotation (default 60 min). */
56
50
  maxSessionMs?: number;
57
- /** Error callback. */
58
51
  onError?: (e: unknown) => void;
59
52
  }
60
53
  interface ReplayHandle {
61
54
  stop: () => void;
62
55
  flush: () => Promise<void>;
63
- sessionId: string;
56
+ /** Current session_id (changes on rotation). */
57
+ readonly sessionId: string;
64
58
  }
65
- /**
66
- * Start recording. Returns a handle with `stop()` and `flush()`.
67
- * Second call is a no-op — returns the existing handle.
68
- */
69
59
  declare function startReplay(gl: GoodLogs, options?: ReplayOptions): Promise<ReplayHandle | null>;
70
60
 
71
61
  export { type ReplayHandle, type ReplayOptions, type RrwebEvent, startReplay };
package/dist/replay.js CHANGED
@@ -1 +1 @@
1
- var S=new Set([1,3,6]);function G(n){return n.every(e=>{if(e.type!==3)return false;let o=e.data?.source;return o!==void 0&&S.has(o)})}var m=null;async function N(n,e={}){if(typeof document>"u")return null;if(m)return m;let o=e.sampleRate??1;if(o<1&&Math.random()>o)return null;let a=e.rrwebRecord??await H();if(!a)return null;let r=n.endpoint,l=n.apiKey,i=n.sessionId,R=n.getDistinctId(),I=e.flushIntervalMs??5e3,E=e.flushBytes??5e5,T=e.sessionTimeoutMs??1800*1e3,B=e.maxSessionMs??3600*1e3,d=[],f=0,C=0,b=false,p=false,g=Date.now(),O=Date.now();u(r,l,{session_id:i,distinct_id:R,start_url:typeof location<"u"?location.href:null,last_url:typeof location<"u"?location.href:null},e.onError);let c=async(t=false)=>{if(d.length===0)return;if(!t&&G(d)){d=[],f=0;return}let s=d,M=s[0].timestamp,_=s[s.length-1].timestamp,P=s.length;d=[],f=0;let $=C++;try{let w=JSON.stringify(s),z=await q(w),U=`${r}/v1/replay/chunks?session_id=${encodeURIComponent(i)}&seq=${$}&start_ts=${encodeURIComponent(new Date(M).toISOString())}&end_ts=${encodeURIComponent(new Date(_).toISOString())}&event_count=${P}`;await fetch(U,{method:"POST",headers:{Authorization:`Bearer ${l}`,"Content-Type":"application/gzip","Content-Encoding":"gzip"},body:z,keepalive:!0});}catch(w){e.onError?.(w);}u(r,l,{session_id:i,last_url:typeof location<"u"?location.href:null,last_activity_at:new Date(_).toISOString(),has_error:b||void 0},e.onError);},x=setInterval(()=>{globalThis.__gl_replay_has_error__&&(b=true);},1e3),v=t=>{if(!p){p=true,clearInterval(A),clearInterval(L),clearInterval(x),document?.removeEventListener("visibilitychange",y),typeof window<"u"&&window.removeEventListener("beforeunload",h);try{D();}catch(s){e.onError?.(s);}c(true),u(r,l,{session_id:i,ended_at:new Date().toISOString()},e.onError),m=null;}},D=a({emit:t=>{if(p)return;t.type===3&&S.has(t.data?.source??-1)||(g=Date.now()),d.push(t),f+=256,f>=E&&c();},checkoutEveryNms:6e4,maskAllInputs:e.maskAllInputs??true,blockSelector:e.blockSelector??"[data-gl-block]",maskTextSelector:e.maskTextSelector??"[data-gl-mask]",sampling:{mousemove:50,mouseInteraction:true,scroll:150,input:"last"}}),A=setInterval(()=>{c();},I),L=setInterval(()=>{let t=Date.now();if(t-g>T){v();return}if(t-O>B){v();return}},1e4),y=()=>{document?.visibilityState==="hidden"&&(c(true),u(r,l,{session_id:i,ended_at:new Date().toISOString()},e.onError));};document.addEventListener("visibilitychange",y);let h=()=>{c(true),u(r,l,{session_id:i,ended_at:new Date().toISOString()},e.onError);};typeof window<"u"&&window.addEventListener("beforeunload",h);let k={sessionId:i,flush:()=>c(true),stop:()=>v()};return m=k,k}async function u(n,e,o,a){try{await fetch(`${n}/v1/replay/sessions`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(o),keepalive:!0});}catch(r){a?.(r);}}async function q(n){if(typeof CompressionStream>"u"||typeof Blob>"u"||typeof Response>"u")return n;let o=new Blob([n]).stream().pipeThrough(new CompressionStream("gzip")),a=await new Response(o).arrayBuffer();return new Blob([a],{type:"application/gzip"})}async function H(){try{let n=await import('rrweb');return n.record??n.default?.record??null}catch{return null}}export{N as startReplay};
1
+ var O=new Set([1,3,6]);function j(t){return t.every(e=>{if(e.type!==3)return false;let o=e.data?.source;return o!==void 0&&O.has(o)})}var w=null;async function V(t,e={}){if(typeof document>"u")return null;if(w)return w;let o=e.sampleRate??1;if(o<1&&Math.random()>o)return null;let i=e.rrwebRecord??await J();if(!i)return null;let r=t.endpoint,a=t.apiKey,p=t,C=e.flushIntervalMs??5e3,M=e.flushBytes??5e5,S=e.sessionTimeoutMs??1800*1e3,L=e.maxSessionMs??3600*1e3,s=p.sessionId,l=[],v=0,x=0,g=false,u=false,f=Date.now(),k=Date.now(),y=null,I=()=>{m(r,a,{session_id:s,distinct_id:p.getDistinctId(),start_url:typeof location<"u"?location.href:null,last_url:typeof location<"u"?location.href:null},e.onError);},R=()=>{d(true),m(r,a,{session_id:s,ended_at:new Date().toISOString()},e.onError);},d=async(n=false)=>{if(l.length===0)return;if(!n&&j(l)){l=[],v=0;return}let c=l,U=c[0].timestamp,D=c[c.length-1].timestamp,G=c.length;l=[],v=0;let q=x++;try{let h=JSON.stringify(c),H=await K(h),N=`${r}/v1/replay/chunks?session_id=${encodeURIComponent(s)}&seq=${q}&start_ts=${encodeURIComponent(new Date(U).toISOString())}&end_ts=${encodeURIComponent(new Date(D).toISOString())}&event_count=${G}`;await fetch(N,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/gzip","Content-Encoding":"gzip"},body:H,keepalive:!0});}catch(h){e.onError?.(h);}m(r,a,{session_id:s,last_url:typeof location<"u"?location.href:null,last_activity_at:new Date(D).toISOString(),has_error:g||void 0},e.onError);},b=()=>{R();try{y?.();}catch(n){e.onError?.(n);}p.newSession(),s=p.getSessionId(),x=0,g=false,f=Date.now(),k=Date.now(),I(),_();},_=()=>{y=i({emit:n=>{if(u)return;n.type===3&&O.has(n.data?.source??-1)||(f=Date.now()),l.push(n),v+=256,v>=M&&d();},checkoutEveryNms:6e4,maskAllInputs:e.maskAllInputs??true,blockSelector:e.blockSelector??"[data-gl-block]",maskTextSelector:e.maskTextSelector??"[data-gl-mask]",sampling:{mousemove:50,mouseInteraction:true,scroll:150,input:"last"}});},A=setInterval(()=>{globalThis.__gl_replay_has_error__&&(g=true);},1e3),P=()=>{if(!u){u=true,clearInterval($),clearInterval(z),clearInterval(A),document?.removeEventListener("visibilitychange",E),typeof window<"u"&&window.removeEventListener("beforeunload",T);try{y?.();}catch(n){e.onError?.(n);}R(),w=null;}};I(),_();let $=setInterval(()=>{d();},C),z=setInterval(()=>{if(u)return;let n=Date.now();if(n-f>S){b();return}if(n-k>L){b();return}},1e4),E=()=>{u||(document?.visibilityState==="hidden"?(d(true),m(r,a,{session_id:s,ended_at:new Date().toISOString()},e.onError)):document?.visibilityState==="visible"&&(Date.now()-f>S?b():f=Date.now()));};document.addEventListener("visibilitychange",E);let T=()=>{d(true),m(r,a,{session_id:s,ended_at:new Date().toISOString()},e.onError);};typeof window<"u"&&window.addEventListener("beforeunload",T);let B={get sessionId(){return s},flush:()=>d(true),stop:P};return w=B,B}async function m(t,e,o,i){try{await fetch(`${t}/v1/replay/sessions`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(o),keepalive:!0});}catch(r){i?.(r);}}async function K(t){if(typeof CompressionStream>"u"||typeof Blob>"u"||typeof Response>"u")return t;let o=new Blob([t]).stream().pipeThrough(new CompressionStream("gzip")),i=await new Response(o).arrayBuffer();return new Blob([i],{type:"application/gzip"})}async function J(){try{let t=await import('rrweb');return t.record??t.default?.record??null}catch{return null}}export{V as startReplay};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aj-2000-test/goodlogs-sdk",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "description": "GoodLogs SDK — ingest logs/events + programmatic API client for queries, alerts, AI",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -21,6 +21,11 @@
21
21
  "import": "./dist/profiling.js",
22
22
  "require": "./dist/profiling.cjs",
23
23
  "types": "./dist/profiling.d.ts"
24
+ },
25
+ "./react": {
26
+ "import": "./dist/react.js",
27
+ "require": "./dist/react.cjs",
28
+ "types": "./dist/react.d.ts"
24
29
  }
25
30
  },
26
31
  "files": [
@@ -47,17 +52,23 @@
47
52
  ],
48
53
  "license": "MIT",
49
54
  "devDependencies": {
55
+ "@types/react": "^19.2.15",
56
+ "react": "^19.2.6",
50
57
  "rrweb": "2.0.0-alpha.18",
51
58
  "tsup": "^8.0.0",
52
59
  "typescript": "^5.5.0",
53
60
  "vitest": "^2.0.0"
54
61
  },
55
62
  "peerDependencies": {
63
+ "react": "^16.5.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
56
64
  "rrweb": "^2.0.0-alpha.18"
57
65
  },
58
66
  "peerDependenciesMeta": {
59
67
  "rrweb": {
60
68
  "optional": true
69
+ },
70
+ "react": {
71
+ "optional": true
61
72
  }
62
73
  }
63
74
  }