@interfere/next 0.0.0-alpha.10
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/LICENSE +21 -0
- package/README.md +307 -0
- package/dist/core/client.d.ts +23 -0
- package/dist/core/client.d.ts.map +1 -0
- package/dist/core/client.js +125 -0
- package/dist/core/client.js.map +1 -0
- package/dist/core/client.test.d.ts +2 -0
- package/dist/core/client.test.d.ts.map +1 -0
- package/dist/core/client.test.js +238 -0
- package/dist/core/client.test.js.map +1 -0
- package/dist/core/encoders.d.ts +3 -0
- package/dist/core/encoders.d.ts.map +1 -0
- package/dist/core/encoders.js +5 -0
- package/dist/core/encoders.js.map +1 -0
- package/dist/core/encoders.test.d.ts +2 -0
- package/dist/core/encoders.test.d.ts.map +1 -0
- package/dist/core/encoders.test.js +55 -0
- package/dist/core/encoders.test.js.map +1 -0
- package/dist/core/error-handlers.d.ts +14 -0
- package/dist/core/error-handlers.d.ts.map +1 -0
- package/dist/core/error-handlers.js +191 -0
- package/dist/core/error-handlers.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/next/error-boundary.d.ts +17 -0
- package/dist/next/error-boundary.d.ts.map +1 -0
- package/dist/next/error-boundary.jsx +32 -0
- package/dist/next/error-boundary.jsx.map +1 -0
- package/dist/next/middleware.d.ts +8 -0
- package/dist/next/middleware.d.ts.map +1 -0
- package/dist/next/middleware.js +139 -0
- package/dist/next/middleware.js.map +1 -0
- package/dist/react/provider.d.ts +16 -0
- package/dist/react/provider.d.ts.map +1 -0
- package/dist/react/provider.jsx +25 -0
- package/dist/react/provider.jsx.map +1 -0
- package/dist/session/replay.d.ts +3 -0
- package/dist/session/replay.d.ts.map +1 -0
- package/dist/session/replay.js +76 -0
- package/dist/session/replay.js.map +1 -0
- package/dist/session/session-summary.d.ts +3 -0
- package/dist/session/session-summary.d.ts.map +1 -0
- package/dist/session/session-summary.js +167 -0
- package/dist/session/session-summary.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React, {} from 'react';
|
|
3
|
+
import { captureErrorBoundaryError } from '../core/error-handlers.js';
|
|
4
|
+
export class InterfereErrorBoundary extends React.Component {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super(props);
|
|
7
|
+
this.state = { hasError: false };
|
|
8
|
+
}
|
|
9
|
+
static getDerivedStateFromError(error) {
|
|
10
|
+
return { hasError: true, error };
|
|
11
|
+
}
|
|
12
|
+
componentDidCatch(error, errorInfo) {
|
|
13
|
+
// React's ErrorInfo might have undefined componentStack, but our handler expects a string
|
|
14
|
+
const errorBoundaryInfo = {
|
|
15
|
+
componentStack: errorInfo.componentStack || '',
|
|
16
|
+
};
|
|
17
|
+
captureErrorBoundaryError(error, errorBoundaryInfo);
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
if (this.state.hasError) {
|
|
21
|
+
if (this.props.fallback) {
|
|
22
|
+
return this.props.fallback;
|
|
23
|
+
}
|
|
24
|
+
return (<div style={{ padding: '20px', textAlign: 'center' }}>
|
|
25
|
+
<h1>Something went wrong.</h1>
|
|
26
|
+
<p>We've been notified about this error.</p>
|
|
27
|
+
</div>);
|
|
28
|
+
}
|
|
29
|
+
return this.props.children;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=error-boundary.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-boundary.jsx","sourceRoot":"","sources":["../../src/next/error-boundary.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAgBtE,MAAM,OAAO,sBAAuB,SAAQ,KAAK,CAAC,SAAuB;IACvE,YAAY,KAAY;QACtB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,wBAAwB,CAAC,KAAY;QAC1C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACnC,CAAC;IAEQ,iBAAiB,CAAC,KAAY,EAAE,SAA0B;QACjE,0FAA0F;QAC1F,MAAM,iBAAiB,GAA2B;YAChD,cAAc,EAAE,SAAS,CAAC,cAAc,IAAI,EAAE;SAC/C,CAAC;QACF,yBAAyB,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;IACtD,CAAC;IAEQ,MAAM;QACb,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACxB,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;gBACxB,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;YAC7B,CAAC;YAED,OAAO,CACL,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CACnD;UAAA,CAAC,EAAE,CAAC,qBAAqB,EAAE,EAAE,CAC7B;UAAA,CAAC,CAAC,CAAC,qCAAqC,EAAE,CAAC,CAC7C;QAAA,EAAE,GAAG,CAAC,CACP,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC7B,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
export declare function withInterfereMiddleware(middleware: (request: NextRequest) => Promise<NextResponse> | NextResponse): (request: NextRequest) => Promise<NextResponse<unknown>>;
|
|
3
|
+
export declare function withInterfereApiRoute(handler: (req: NextRequest) => Promise<Response>): (req: NextRequest) => Promise<Response>;
|
|
4
|
+
export declare function withInterfereServerComponent<T extends (...args: unknown[]) => Promise<unknown>>(component: T, componentName?: string): T;
|
|
5
|
+
export declare function createInterfereErrorHandler(): (error: Error, errorInfo: {
|
|
6
|
+
digest?: string;
|
|
7
|
+
}) => void;
|
|
8
|
+
//# sourceMappingURL=middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/next/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK7D,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,IAE5D,SAAS,WAAW,oCAgDnC;AAGD,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,IAElC,KAAK,WAAW,uBAgD/B;AAGD,wBAAgB,4BAA4B,CAC1C,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,EAClD,SAAS,EAAE,CAAC,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,CAAC,CAgBzC;AAGD,wBAAgB,2BAA2B,KACjC,OAAO,KAAK,EAAE,WAAW;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,UAUrD"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { capture } from '../core/client.js';
|
|
2
|
+
import { captureServerError } from '../core/error-handlers.js';
|
|
3
|
+
// Middleware wrapper to capture errors
|
|
4
|
+
export function withInterfereMiddleware(middleware) {
|
|
5
|
+
return async (request) => {
|
|
6
|
+
const startTime = Date.now();
|
|
7
|
+
try {
|
|
8
|
+
// Try to capture the request, but don't fail if SDK isn't initialized
|
|
9
|
+
try {
|
|
10
|
+
capture('edge_req', {
|
|
11
|
+
type: 'middleware_request',
|
|
12
|
+
url: request.url,
|
|
13
|
+
method: request.method,
|
|
14
|
+
headers: Object.fromEntries(request.headers.entries()),
|
|
15
|
+
pathname: request.nextUrl.pathname,
|
|
16
|
+
timestamp: startTime,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
// SDK not initialized yet, skip capture
|
|
21
|
+
}
|
|
22
|
+
const response = await middleware(request);
|
|
23
|
+
// Try to capture successful response timing
|
|
24
|
+
try {
|
|
25
|
+
capture('edge_req', {
|
|
26
|
+
type: 'middleware_response',
|
|
27
|
+
url: request.url,
|
|
28
|
+
statusCode: response.status,
|
|
29
|
+
duration: Date.now() - startTime,
|
|
30
|
+
timestamp: Date.now(),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
// SDK not initialized yet, skip capture
|
|
35
|
+
}
|
|
36
|
+
return response;
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
// Try to capture middleware errors
|
|
40
|
+
try {
|
|
41
|
+
captureServerError(error, request, {
|
|
42
|
+
pathname: request.nextUrl.pathname,
|
|
43
|
+
middleware: true,
|
|
44
|
+
duration: Date.now() - startTime,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
// SDK not initialized yet, skip capture
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
// Helper for API route error handling
|
|
55
|
+
export function withInterfereApiRoute(handler) {
|
|
56
|
+
return async (req) => {
|
|
57
|
+
const startTime = Date.now();
|
|
58
|
+
try {
|
|
59
|
+
// Try to capture API route request
|
|
60
|
+
try {
|
|
61
|
+
capture('server_req', {
|
|
62
|
+
type: 'api_route_request',
|
|
63
|
+
url: req.url,
|
|
64
|
+
method: req.method,
|
|
65
|
+
headers: Object.fromEntries(req.headers.entries()),
|
|
66
|
+
pathname: req.nextUrl.pathname,
|
|
67
|
+
timestamp: startTime,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
// SDK not initialized yet, skip capture
|
|
72
|
+
}
|
|
73
|
+
const response = await handler(req);
|
|
74
|
+
// Try to capture response info
|
|
75
|
+
try {
|
|
76
|
+
capture('server_req', {
|
|
77
|
+
type: 'api_route_response',
|
|
78
|
+
url: req.url,
|
|
79
|
+
statusCode: response.status,
|
|
80
|
+
duration: Date.now() - startTime,
|
|
81
|
+
timestamp: Date.now(),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
// SDK not initialized yet, skip capture
|
|
86
|
+
}
|
|
87
|
+
return response;
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
// Try to capture the error
|
|
91
|
+
try {
|
|
92
|
+
captureServerError(error, req, {
|
|
93
|
+
pathname: req.nextUrl.pathname,
|
|
94
|
+
type: 'api_route',
|
|
95
|
+
duration: Date.now() - startTime,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
// SDK not initialized yet, skip capture
|
|
100
|
+
}
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
// Helper for server component error handling
|
|
106
|
+
export function withInterfereServerComponent(component, componentName) {
|
|
107
|
+
return (async (...args) => {
|
|
108
|
+
try {
|
|
109
|
+
return await component(...args);
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
try {
|
|
113
|
+
captureServerError(error, undefined, {
|
|
114
|
+
type: 'server_component',
|
|
115
|
+
componentName: componentName || component.name,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
// SDK not initialized yet, skip capture
|
|
120
|
+
}
|
|
121
|
+
throw error;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
// App directory error handling
|
|
126
|
+
export function createInterfereErrorHandler() {
|
|
127
|
+
return (error, errorInfo) => {
|
|
128
|
+
try {
|
|
129
|
+
captureServerError(error, undefined, {
|
|
130
|
+
digest: errorInfo.digest,
|
|
131
|
+
type: 'app_directory_error',
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
// SDK not initialized yet, skip capture
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=middleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../src/next/middleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,uCAAuC;AACvC,MAAM,UAAU,uBAAuB,CACrC,UAA0E;IAE1E,OAAO,KAAK,EAAE,OAAoB,EAAE,EAAE;QACpC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,IAAI,CAAC;YACH,sEAAsE;YACtE,IAAI,CAAC;gBACH,OAAO,CAAC,UAAU,EAAE;oBAClB,IAAI,EAAE,oBAAoB;oBAC1B,GAAG,EAAE,OAAO,CAAC,GAAG;oBAChB,MAAM,EAAE,OAAO,CAAC,MAAM;oBACtB,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;oBACtD,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ;oBAClC,SAAS,EAAE,SAAS;iBACrB,CAAC,CAAC;YACL,CAAC;YAAC,MAAM,CAAC;gBACP,wCAAwC;YAC1C,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;YAE3C,4CAA4C;YAC5C,IAAI,CAAC;gBACH,OAAO,CAAC,UAAU,EAAE;oBAClB,IAAI,EAAE,qBAAqB;oBAC3B,GAAG,EAAE,OAAO,CAAC,GAAG;oBAChB,UAAU,E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YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CAAM,CAAC;AACV,CAAC;AAED,+BAA+B;AAC/B,MAAM,UAAU,2BAA2B;IACzC,OAAO,CAAC,KAAY,EAAE,SAA8B,EAAE,EAAE;QACtD,IAAI,CAAC;YACH,kBAAkB,CAAC,KAAK,EAAE,SAAS,EAAE;gBACnC,MAAM,EAAE,SAAS,CAAC,MAAM;gBACxB,IAAI,EAAE,qBAAqB;aAC5B,CAAC,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACP,wCAAwC;QAC1C,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Config, SurfaceId } from '@interfere/schemas';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import { capture, flush, getSessionId } from '../core/client.js';
|
|
4
|
+
interface InterfereProviderProps {
|
|
5
|
+
surface: SurfaceId;
|
|
6
|
+
options?: Partial<Config>;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function InterfereProvider(props: InterfereProviderProps): import("react").JSX.Element;
|
|
10
|
+
export declare function useInterfere(): {
|
|
11
|
+
capture: typeof capture;
|
|
12
|
+
flush: typeof flush;
|
|
13
|
+
getSessionId: typeof getSessionId;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/react/provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAiB,KAAK,SAAS,EAAyB,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAQ,MAAM,mBAAmB,CAAC;AAUvE,UAAU,sBAAsB;IAC9B,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAc9D;AAED,wBAAgB,YAAY;aA3BjB,OAAO,OAAO;WAChB,OAAO,KAAK;kBACL,OAAO,YAAY;EA+BlC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createContext, useContext, useEffect } from 'react';
|
|
3
|
+
import { capture, flush, getSessionId, init } from '../core/client.js';
|
|
4
|
+
import { setupReplay } from '../session/replay.js';
|
|
5
|
+
import { setupSessionSummary } from '../session/session-summary.js';
|
|
6
|
+
const InterfereContext = createContext(null);
|
|
7
|
+
export function InterfereProvider(props) {
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
init(props);
|
|
10
|
+
setupSessionSummary(props.options);
|
|
11
|
+
setupReplay(props.options);
|
|
12
|
+
return () => flush();
|
|
13
|
+
}, [props]);
|
|
14
|
+
return (<InterfereContext.Provider value={{ capture, flush, getSessionId }}>
|
|
15
|
+
{props.children}
|
|
16
|
+
</InterfereContext.Provider>);
|
|
17
|
+
}
|
|
18
|
+
export function useInterfere() {
|
|
19
|
+
const context = useContext(InterfereContext);
|
|
20
|
+
if (!context) {
|
|
21
|
+
throw new Error('useInterfere() must be used within InterfereProvider');
|
|
22
|
+
}
|
|
23
|
+
return context;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=provider.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.jsx","sourceRoot":"","sources":["../../src/react/provider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAGb,OAAO,EAAE,aAAa,EAAkB,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,gBAAgB,GAAG,aAAa,CAI5B,IAAI,CAAC,CAAC;AAQhB,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC7D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,KAAK,CAAC,CAAC;QACZ,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACnC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAE3B,OAAO,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,CACL,CAAC,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CACjE;MAAA,CAAC,KAAK,CAAC,QAAQ,CACjB;IAAA,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAC7B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC7C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../src/session/replay.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,QA6EpD"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/* Session replay capture using rrweb, chunked streaming to ingest */
|
|
2
|
+
'use client';
|
|
3
|
+
import { capture, flush } from '../core/client.js';
|
|
4
|
+
let started = false;
|
|
5
|
+
export function setupReplay(options) {
|
|
6
|
+
if (started) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
if (typeof window === 'undefined') {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const enable = options?.enableReplay ?? false;
|
|
13
|
+
if (!enable) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
started = true;
|
|
17
|
+
import('rrweb')
|
|
18
|
+
.then((module) => {
|
|
19
|
+
// Handle different module export patterns
|
|
20
|
+
const rrwebModule = module.default || module;
|
|
21
|
+
const record = rrwebModule.record || rrwebModule;
|
|
22
|
+
const events = [];
|
|
23
|
+
const chunkMs = options?.replayChunkMs ?? 10_000;
|
|
24
|
+
// Check if record is a function
|
|
25
|
+
if (typeof record !== 'function') {
|
|
26
|
+
// biome-ignore lint/suspicious/noConsole: error logging needed
|
|
27
|
+
console.error('rrweb.record is not available');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
record({
|
|
31
|
+
emit(event) {
|
|
32
|
+
events.push(event);
|
|
33
|
+
},
|
|
34
|
+
maskAllInputs: options?.replayMaskAllText ?? true,
|
|
35
|
+
});
|
|
36
|
+
const sendChunk = () => {
|
|
37
|
+
if (events.length === 0) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const chunk = events.splice(0, events.length);
|
|
41
|
+
try {
|
|
42
|
+
capture('replay_chunk', {
|
|
43
|
+
version: 1,
|
|
44
|
+
chunkTs: Date.now(),
|
|
45
|
+
count: chunk.length,
|
|
46
|
+
// rrweb events are JSON serializable; rely on encoder for compression
|
|
47
|
+
events: chunk,
|
|
48
|
+
});
|
|
49
|
+
flush();
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// swallow
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
window.setInterval(sendChunk, chunkMs);
|
|
56
|
+
const flushNow = () => {
|
|
57
|
+
try {
|
|
58
|
+
sendChunk();
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// swallow
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
window.addEventListener('beforeunload', flushNow);
|
|
65
|
+
document.addEventListener('visibilitychange', () => {
|
|
66
|
+
if (document.visibilityState === 'hidden') {
|
|
67
|
+
flushNow();
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
})
|
|
71
|
+
.catch((error) => {
|
|
72
|
+
// biome-ignore lint/suspicious/noConsole: Just for testing
|
|
73
|
+
console.error('Failed to load rrweb:', error);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=replay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.js","sourceRoot":"","sources":["../../src/session/replay.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,YAAY,CAAC;AAGb,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnD,IAAI,OAAO,GAAG,KAAK,CAAC;AAEpB,MAAM,UAAU,WAAW,CAAC,OAAyB;IACnD,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,EAAE,YAAY,IAAI,KAAK,CAAC;IAC9C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IAED,OAAO,GAAG,IAAI,CAAC;IAEf,MAAM,CAAC,OAAO,CAAC;SACZ,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;QACf,0CAA0C;QAC1C,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC;QAC7C,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,IAAI,WAAW,CAAC;QAEjD,MAAM,MAAM,GAAc,EAAE,CAAC;QAC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AI,QAAQ,CAAC,eAAe,KAAK,QAAQ,EAAE,CAAC;gBAC1C,QAAQ,EAAE,CAAC;YACb,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACf,2DAA2D;QAC3D,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-summary.d.ts","sourceRoot":"","sources":["../../src/session/session-summary.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAqGjD,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,QAkI5D"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Lightweight client-side session summarization.
|
|
3
|
+
- Buffers small UI signals and errors
|
|
4
|
+
- On window or time window end, tries to summarize using in-browser AI (window.ai)
|
|
5
|
+
- Sends a compact 'session_summary' event instead of raw replay
|
|
6
|
+
*/
|
|
7
|
+
import { capture } from '../core/client.js';
|
|
8
|
+
let initialized = false;
|
|
9
|
+
let buffer = [];
|
|
10
|
+
// interval-driven scheduling, no explicit timer var to satisfy lints
|
|
11
|
+
function isBrowser() {
|
|
12
|
+
return typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
13
|
+
}
|
|
14
|
+
function pushEvent(event, maxEvents) {
|
|
15
|
+
buffer.push(event);
|
|
16
|
+
if (buffer.length > maxEvents) {
|
|
17
|
+
buffer.shift();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async function summarizeWithBrowserAI(items) {
|
|
21
|
+
const w = window;
|
|
22
|
+
if (!w.ai || typeof w.ai.canCreateTextSession !== 'function') {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
const readiness = await w.ai.canCreateTextSession();
|
|
27
|
+
if (readiness !== 'readily' && readiness !== 'after-download') {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const session = await w.ai.createTextSession({
|
|
31
|
+
temperature: 0.2,
|
|
32
|
+
topK: 40,
|
|
33
|
+
topP: 0.95,
|
|
34
|
+
});
|
|
35
|
+
const prompt = `You are summarizing a brief series of UI events and errors from a web session. Return a compact JSON with keys: summary (string, <= 300 chars), keyActions (string[]), errors (string[]). Do not include any PII.\n\nEvents:\n${items
|
|
36
|
+
.map((e) => e.kind === 'ui'
|
|
37
|
+
? `UI:${e.action}${e.label ? `:${e.label}` : ''}@${new Date(e.ts).toISOString()}`
|
|
38
|
+
: `ERR:${e.name ?? 'Error'}:${e.message}@${new Date(e.ts).toISOString()}`)
|
|
39
|
+
.join('\n')}`;
|
|
40
|
+
const out = await session.prompt(prompt);
|
|
41
|
+
if (typeof out !== 'string' || out.length === 0) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
return out.slice(0, 2000);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async function emitSummary(allowBrowserAI) {
|
|
51
|
+
const items = buffer.slice();
|
|
52
|
+
buffer = [];
|
|
53
|
+
if (items.length === 0) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
let summary = null;
|
|
57
|
+
if (allowBrowserAI) {
|
|
58
|
+
summary = await summarizeWithBrowserAI(items);
|
|
59
|
+
}
|
|
60
|
+
const payload = {
|
|
61
|
+
version: 1,
|
|
62
|
+
windowMs: undefined,
|
|
63
|
+
eventCount: items.length,
|
|
64
|
+
sample: items.slice(-20),
|
|
65
|
+
summary,
|
|
66
|
+
};
|
|
67
|
+
try {
|
|
68
|
+
capture('session_summary', payload);
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
// ignore if not initialized yet
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export function setupSessionSummary(options) {
|
|
75
|
+
if (initialized) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (!isBrowser()) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const enable = options?.enableSessionSummary ?? false;
|
|
82
|
+
if (!enable) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
initialized = true;
|
|
86
|
+
const windowMs = options?.sessionSummaryWindowMs ?? 10_000;
|
|
87
|
+
const maxEvents = options?.sessionSummaryMaxEvents ?? 200;
|
|
88
|
+
const allowBrowserAI = options?.allowBrowserAI ?? true;
|
|
89
|
+
// Basic UI signals
|
|
90
|
+
document.addEventListener('click', (e) => {
|
|
91
|
+
const target = e.target;
|
|
92
|
+
const label = target?.getAttribute('aria-label') ||
|
|
93
|
+
target?.innerText?.slice(0, 60) ||
|
|
94
|
+
undefined;
|
|
95
|
+
pushEvent({ kind: 'ui', action: 'click', label, ts: Date.now() }, maxEvents);
|
|
96
|
+
}, { capture: true });
|
|
97
|
+
document.addEventListener('keydown', () => {
|
|
98
|
+
// Avoid capturing actual keys for privacy; log only that a key interaction occurred
|
|
99
|
+
pushEvent({ kind: 'ui', action: 'key', ts: Date.now() }, maxEvents);
|
|
100
|
+
}, { capture: true });
|
|
101
|
+
// Basic navigation signals
|
|
102
|
+
try {
|
|
103
|
+
const originalPushState = history.pushState.bind(history);
|
|
104
|
+
const newPushState = (...args) => {
|
|
105
|
+
pushEvent({ kind: 'ui', action: 'nav', label: 'push', ts: Date.now() }, maxEvents);
|
|
106
|
+
return originalPushState(...args);
|
|
107
|
+
};
|
|
108
|
+
history.pushState = newPushState;
|
|
109
|
+
const originalReplaceState = history.replaceState.bind(history);
|
|
110
|
+
const newReplaceState = (...args) => {
|
|
111
|
+
pushEvent({ kind: 'ui', action: 'nav', label: 'replace', ts: Date.now() }, maxEvents);
|
|
112
|
+
return originalReplaceState(...args);
|
|
113
|
+
};
|
|
114
|
+
history.replaceState = newReplaceState;
|
|
115
|
+
window.addEventListener('popstate', () => {
|
|
116
|
+
pushEvent({ kind: 'ui', action: 'nav', label: 'pop', ts: Date.now() }, maxEvents);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
// Ignore if history API not available
|
|
121
|
+
}
|
|
122
|
+
// Lightweight error hook (in addition to error-handlers)
|
|
123
|
+
window.addEventListener('error', (ev) => {
|
|
124
|
+
if (!ev?.message) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
pushEvent({
|
|
128
|
+
kind: 'error',
|
|
129
|
+
message: String(ev.message),
|
|
130
|
+
name: 'WindowError',
|
|
131
|
+
ts: Date.now(),
|
|
132
|
+
}, maxEvents);
|
|
133
|
+
});
|
|
134
|
+
window.addEventListener('unhandledrejection', (ev) => {
|
|
135
|
+
const msg = ev?.reason
|
|
136
|
+
? String(ev.reason?.message ?? ev.reason)
|
|
137
|
+
: 'unhandledrejection';
|
|
138
|
+
pushEvent({
|
|
139
|
+
kind: 'error',
|
|
140
|
+
message: msg,
|
|
141
|
+
name: 'UnhandledRejection',
|
|
142
|
+
ts: Date.now(),
|
|
143
|
+
}, maxEvents);
|
|
144
|
+
});
|
|
145
|
+
// Timer-based summary emission
|
|
146
|
+
const run = () => {
|
|
147
|
+
// Swallow errors to avoid impacting the host app
|
|
148
|
+
emitSummary(allowBrowserAI).catch(() => {
|
|
149
|
+
/* no-op */
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
window.setInterval(run, windowMs);
|
|
153
|
+
// Emit on page hide/visibility change to avoid losing the last window
|
|
154
|
+
const flushNow = () => {
|
|
155
|
+
// Swallow errors to avoid impacting the host app
|
|
156
|
+
emitSummary(allowBrowserAI).catch(() => {
|
|
157
|
+
/* no-op */
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
window.addEventListener('beforeunload', flushNow);
|
|
161
|
+
document.addEventListener('visibilitychange', () => {
|
|
162
|
+
if (document.visibilityState === 'hidden') {
|
|
163
|
+
flushNow();
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=session-summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-summary.js","sourceRoot":"","sources":["../../src/session/session-summary.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAGF,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAM5C,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB,IAAI,MAAM,GAAmB,EAAE,CAAC;AAChC,qEAAqE;AAErE,SAAS,SAAS;IAChB,OAAO,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAC;AAC1E,CAAC;AAED,SAAS,SAAS,CAAC,KAAmB,EAAE,SAAiB;IACvD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnB,IAAI,MAAM,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;QAC9B,MAAM,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;AACH,CAAC;AAeD,KAAK,UAAU,sBAAsB,CACnC,KAAqB;IAErB,MAAM,CAAC,GAAG,MAAuC,CAAC;IAClD,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,oBAAoB,KAAK,UAAU,EAAE,CAAC;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC;QACpD,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,gBAAgB,EAAE,CAAC;YAC9D,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,iBAAiB,CAAC;YAC3C,WAAW,EAAE,GAAG;YAChB,IAAI,EAAE,EAAE;YACR,IAAI,EAAE,IAAI;SACX,C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AC,CAAC;IAElC,sEAAsE;IACtE,MAAM,QAAQ,GAAG,GAAG,EAAE;QACpB,iDAAiD;QACjD,WAAW,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;YACrC,WAAW;QACb,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IACF,MAAM,CAAC,gBAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IAClD,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,GAAG,EAAE;QACjD,IAAI,QAAQ,CAAC,eAAe,KAAK,QAAQ,EAAE,CAAC;YAC1C,QAAQ,EAAE,CAAC;QACb,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@interfere/next",
|
|
3
|
+
"version": "0.0.0-alpha.10",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "Build apps that never break.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"observability",
|
|
8
|
+
"typescript",
|
|
9
|
+
"nextjs",
|
|
10
|
+
"logging"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://interfere.com",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "mailto:support@interfere.com"
|
|
15
|
+
},
|
|
16
|
+
"author": "Interfere <support@interfere.com> (https://interfere.com)",
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"nanoid": "^5.1.5",
|
|
28
|
+
"rrweb": "^2.0.0-alpha.18",
|
|
29
|
+
"@interfere/schemas": "0.0.3"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"next": ">=15",
|
|
33
|
+
"react": ">=19",
|
|
34
|
+
"react-dom": ">=19"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "22.15.29",
|
|
38
|
+
"@types/react": "19.1.9",
|
|
39
|
+
"@types/react-dom": "19.1.7",
|
|
40
|
+
"next": "^15.4.6",
|
|
41
|
+
"react": "^19.1.1",
|
|
42
|
+
"react-dom": "^19.1.1",
|
|
43
|
+
"typescript": "5.9.2",
|
|
44
|
+
"vitest": "^3.2.4",
|
|
45
|
+
"@interfere/typescript-config": "1.0.1"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsc",
|
|
49
|
+
"dev": "tsc --watch",
|
|
50
|
+
"check-types": "tsc --noEmit",
|
|
51
|
+
"test": "vitest run"
|
|
52
|
+
}
|
|
53
|
+
}
|