sitepong 0.0.6 → 0.0.8
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/breadcrumbs-Cydh62b1.d.mts +125 -0
- package/dist/breadcrumbs-DRlJ9h_B.d.ts +125 -0
- package/dist/express/index.d.mts +47 -0
- package/dist/express/index.d.ts +47 -0
- package/dist/express/index.js +128 -0
- package/dist/express/index.js.map +1 -0
- package/dist/express/index.mjs +124 -0
- package/dist/express/index.mjs.map +1 -0
- package/dist/index.d.mts +4 -59
- package/dist/index.d.ts +4 -59
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/nextjs/index.d.mts +110 -0
- package/dist/nextjs/index.d.ts +110 -0
- package/dist/nextjs/index.js +440 -0
- package/dist/nextjs/index.js.map +1 -0
- package/dist/nextjs/index.mjs +431 -0
- package/dist/nextjs/index.mjs.map +1 -0
- package/dist/react/index.d.mts +5 -112
- package/dist/react/index.d.ts +5 -112
- package/dist/server/index.d.mts +47 -0
- package/dist/server/index.d.ts +47 -0
- package/dist/server/index.js +360 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/index.mjs +352 -0
- package/dist/server/index.mjs.map +1 -0
- package/dist/types-CLEYbaV8.d.mts +88 -0
- package/dist/types-CLEYbaV8.d.ts +88 -0
- package/package.json +34 -3
package/dist/react/index.d.mts
CHANGED
|
@@ -1,111 +1,9 @@
|
|
|
1
1
|
import React, { Component, ReactNode, ErrorInfo } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
interface SitePongConfig {
|
|
9
|
-
/** DSN in format: https://<public_key>@ingest.sitepong.com/<project_id> */
|
|
10
|
-
dsn?: string;
|
|
11
|
-
/** API key in format: sp_live_xxx or sp_test_xxx */
|
|
12
|
-
apiKey?: string;
|
|
13
|
-
/** Environment name (e.g., 'production', 'staging', 'development') */
|
|
14
|
-
environment?: string;
|
|
15
|
-
/** Release/version string */
|
|
16
|
-
release?: string;
|
|
17
|
-
/** Enable debug logging */
|
|
18
|
-
debug?: boolean;
|
|
19
|
-
/** Enable/disable the SDK entirely */
|
|
20
|
-
enabled?: boolean;
|
|
21
|
-
/** Sample rate for errors (0.0 to 1.0) */
|
|
22
|
-
sampleRate?: number;
|
|
23
|
-
/** Maximum number of breadcrumbs to keep */
|
|
24
|
-
maxBreadcrumbs?: number;
|
|
25
|
-
/** Hook to modify or filter events before sending */
|
|
26
|
-
beforeSend?: (event: ErrorEvent) => ErrorEvent | null;
|
|
27
|
-
/** Auto-capture configuration */
|
|
28
|
-
autoCapture?: {
|
|
29
|
-
errors?: boolean;
|
|
30
|
-
unhandledRejections?: boolean;
|
|
31
|
-
console?: boolean;
|
|
32
|
-
};
|
|
33
|
-
/** Custom API endpoint (for self-hosted) */
|
|
34
|
-
apiEndpoint?: string;
|
|
35
|
-
}
|
|
36
|
-
interface User {
|
|
37
|
-
id?: string;
|
|
38
|
-
email?: string;
|
|
39
|
-
username?: string;
|
|
40
|
-
[key: string]: unknown;
|
|
41
|
-
}
|
|
42
|
-
interface Breadcrumb {
|
|
43
|
-
type: "default" | "http" | "navigation" | "ui" | "console" | "error";
|
|
44
|
-
category?: string;
|
|
45
|
-
message?: string;
|
|
46
|
-
level?: "fatal" | "error" | "warning" | "info" | "debug";
|
|
47
|
-
timestamp: number;
|
|
48
|
-
data?: Record<string, unknown>;
|
|
49
|
-
}
|
|
50
|
-
interface ErrorEvent {
|
|
51
|
-
event_id: string;
|
|
52
|
-
timestamp: string;
|
|
53
|
-
level: "fatal" | "error" | "warning" | "info" | "debug";
|
|
54
|
-
message: string;
|
|
55
|
-
exception?: {
|
|
56
|
-
type: string;
|
|
57
|
-
value: string;
|
|
58
|
-
stacktrace?: StackFrame[];
|
|
59
|
-
};
|
|
60
|
-
tags?: Record<string, string>;
|
|
61
|
-
extra?: Record<string, unknown>;
|
|
62
|
-
user?: User;
|
|
63
|
-
breadcrumbs?: Breadcrumb[];
|
|
64
|
-
context?: {
|
|
65
|
-
browser?: BrowserContext;
|
|
66
|
-
os?: OSContext;
|
|
67
|
-
device?: DeviceContext;
|
|
68
|
-
[key: string]: unknown;
|
|
69
|
-
};
|
|
70
|
-
environment?: string;
|
|
71
|
-
release?: string;
|
|
72
|
-
request?: {
|
|
73
|
-
url?: string;
|
|
74
|
-
method?: string;
|
|
75
|
-
headers?: Record<string, string>;
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
interface StackFrame {
|
|
79
|
-
filename?: string;
|
|
80
|
-
function?: string;
|
|
81
|
-
lineno?: number;
|
|
82
|
-
colno?: number;
|
|
83
|
-
in_app?: boolean;
|
|
84
|
-
context_line?: string;
|
|
85
|
-
pre_context?: string[];
|
|
86
|
-
post_context?: string[];
|
|
87
|
-
}
|
|
88
|
-
interface BrowserContext {
|
|
89
|
-
name?: string;
|
|
90
|
-
version?: string;
|
|
91
|
-
}
|
|
92
|
-
interface OSContext {
|
|
93
|
-
name?: string;
|
|
94
|
-
version?: string;
|
|
95
|
-
}
|
|
96
|
-
interface DeviceContext {
|
|
97
|
-
family?: string;
|
|
98
|
-
model?: string;
|
|
99
|
-
brand?: string;
|
|
100
|
-
}
|
|
101
|
-
type LogLevel = "fatal" | "error" | "warning" | "info" | "debug";
|
|
102
|
-
interface CaptureContext {
|
|
103
|
-
tags?: Record<string, string>;
|
|
104
|
-
extra?: Record<string, unknown>;
|
|
105
|
-
user?: User;
|
|
106
|
-
level?: LogLevel;
|
|
107
|
-
fingerprint?: string[];
|
|
108
|
-
}
|
|
2
|
+
import { S as SitePongConfig, C as CaptureContext, L as LogLevel, U as User, a as addBreadcrumb } from '../breadcrumbs-Cydh62b1.mjs';
|
|
3
|
+
import { T as TrackProperties, U as UserTraits, G as GroupTraits } from '../types-CLEYbaV8.mjs';
|
|
4
|
+
export { R as ReplayConfig, a as ReplayEvent } from '../types-CLEYbaV8.mjs';
|
|
5
|
+
import { DeviceSignals, WebVitals } from '../index.mjs';
|
|
6
|
+
export { CapturedError, CronCheckinOptions, CronHandle, DatabaseQueryEvent, DatabaseTrackerConfig, ErrorContext, FraudCheckResult, MetricOptions, PerformanceConfig, PerformanceSpan, PerformanceTransaction, ProfileData, ProfileFrame, ProfilerConfig, SitePongConfig, SitePongInitConfig, TraceContext, TracePropagator, VisitorIdResult, areFlagsReady, captureError, captureMessage, clearAnonymousId, createTraceContext, cronCheckin, cronStart, cronWrap, dbTrack, dbTrackSync, endSpan, endTransaction, extractTrace, flush, flushMetrics, flushProfiles, generateSpanId, generateTraceId, getAllFlags, getAnonymousId, getDbNPlusOnePatterns, getDbQueryCount, getDeviceSignals, getFlag, getFraudCheck, getLatestProfile, getProfiles, getReplaySessionId, getVariant, getVariantPayload, getVisitorId, getWebVitals, group, identify, init, isReplayRecording, metricDistribution, metricGauge, metricHistogram, metricIncrement, metricStartTimer, metricTime, profile, propagateTrace, refreshFlags, resetAnalytics, resetDbQueryCount, setAnonymousId, setContext, setTags, setUser, startProfileSpan, startReplay, startSpan, startTransaction, stopReplay, track, trackPageView, waitForFlags } from '../index.mjs';
|
|
109
7
|
|
|
110
8
|
interface SitePongContextValue {
|
|
111
9
|
isInitialized: boolean;
|
|
@@ -215,11 +113,6 @@ declare class SitePongErrorBoundary extends Component<SitePongErrorBoundaryProps
|
|
|
215
113
|
render(): ReactNode;
|
|
216
114
|
}
|
|
217
115
|
|
|
218
|
-
/**
|
|
219
|
-
* Add a breadcrumb to the trail
|
|
220
|
-
*/
|
|
221
|
-
declare function addBreadcrumb(breadcrumb: Omit<Breadcrumb, "timestamp">): void;
|
|
222
|
-
|
|
223
116
|
/**
|
|
224
117
|
* Hook to access all SitePong SDK methods
|
|
225
118
|
*
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,111 +1,9 @@
|
|
|
1
1
|
import React, { Component, ReactNode, ErrorInfo } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
interface SitePongConfig {
|
|
9
|
-
/** DSN in format: https://<public_key>@ingest.sitepong.com/<project_id> */
|
|
10
|
-
dsn?: string;
|
|
11
|
-
/** API key in format: sp_live_xxx or sp_test_xxx */
|
|
12
|
-
apiKey?: string;
|
|
13
|
-
/** Environment name (e.g., 'production', 'staging', 'development') */
|
|
14
|
-
environment?: string;
|
|
15
|
-
/** Release/version string */
|
|
16
|
-
release?: string;
|
|
17
|
-
/** Enable debug logging */
|
|
18
|
-
debug?: boolean;
|
|
19
|
-
/** Enable/disable the SDK entirely */
|
|
20
|
-
enabled?: boolean;
|
|
21
|
-
/** Sample rate for errors (0.0 to 1.0) */
|
|
22
|
-
sampleRate?: number;
|
|
23
|
-
/** Maximum number of breadcrumbs to keep */
|
|
24
|
-
maxBreadcrumbs?: number;
|
|
25
|
-
/** Hook to modify or filter events before sending */
|
|
26
|
-
beforeSend?: (event: ErrorEvent) => ErrorEvent | null;
|
|
27
|
-
/** Auto-capture configuration */
|
|
28
|
-
autoCapture?: {
|
|
29
|
-
errors?: boolean;
|
|
30
|
-
unhandledRejections?: boolean;
|
|
31
|
-
console?: boolean;
|
|
32
|
-
};
|
|
33
|
-
/** Custom API endpoint (for self-hosted) */
|
|
34
|
-
apiEndpoint?: string;
|
|
35
|
-
}
|
|
36
|
-
interface User {
|
|
37
|
-
id?: string;
|
|
38
|
-
email?: string;
|
|
39
|
-
username?: string;
|
|
40
|
-
[key: string]: unknown;
|
|
41
|
-
}
|
|
42
|
-
interface Breadcrumb {
|
|
43
|
-
type: "default" | "http" | "navigation" | "ui" | "console" | "error";
|
|
44
|
-
category?: string;
|
|
45
|
-
message?: string;
|
|
46
|
-
level?: "fatal" | "error" | "warning" | "info" | "debug";
|
|
47
|
-
timestamp: number;
|
|
48
|
-
data?: Record<string, unknown>;
|
|
49
|
-
}
|
|
50
|
-
interface ErrorEvent {
|
|
51
|
-
event_id: string;
|
|
52
|
-
timestamp: string;
|
|
53
|
-
level: "fatal" | "error" | "warning" | "info" | "debug";
|
|
54
|
-
message: string;
|
|
55
|
-
exception?: {
|
|
56
|
-
type: string;
|
|
57
|
-
value: string;
|
|
58
|
-
stacktrace?: StackFrame[];
|
|
59
|
-
};
|
|
60
|
-
tags?: Record<string, string>;
|
|
61
|
-
extra?: Record<string, unknown>;
|
|
62
|
-
user?: User;
|
|
63
|
-
breadcrumbs?: Breadcrumb[];
|
|
64
|
-
context?: {
|
|
65
|
-
browser?: BrowserContext;
|
|
66
|
-
os?: OSContext;
|
|
67
|
-
device?: DeviceContext;
|
|
68
|
-
[key: string]: unknown;
|
|
69
|
-
};
|
|
70
|
-
environment?: string;
|
|
71
|
-
release?: string;
|
|
72
|
-
request?: {
|
|
73
|
-
url?: string;
|
|
74
|
-
method?: string;
|
|
75
|
-
headers?: Record<string, string>;
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
interface StackFrame {
|
|
79
|
-
filename?: string;
|
|
80
|
-
function?: string;
|
|
81
|
-
lineno?: number;
|
|
82
|
-
colno?: number;
|
|
83
|
-
in_app?: boolean;
|
|
84
|
-
context_line?: string;
|
|
85
|
-
pre_context?: string[];
|
|
86
|
-
post_context?: string[];
|
|
87
|
-
}
|
|
88
|
-
interface BrowserContext {
|
|
89
|
-
name?: string;
|
|
90
|
-
version?: string;
|
|
91
|
-
}
|
|
92
|
-
interface OSContext {
|
|
93
|
-
name?: string;
|
|
94
|
-
version?: string;
|
|
95
|
-
}
|
|
96
|
-
interface DeviceContext {
|
|
97
|
-
family?: string;
|
|
98
|
-
model?: string;
|
|
99
|
-
brand?: string;
|
|
100
|
-
}
|
|
101
|
-
type LogLevel = "fatal" | "error" | "warning" | "info" | "debug";
|
|
102
|
-
interface CaptureContext {
|
|
103
|
-
tags?: Record<string, string>;
|
|
104
|
-
extra?: Record<string, unknown>;
|
|
105
|
-
user?: User;
|
|
106
|
-
level?: LogLevel;
|
|
107
|
-
fingerprint?: string[];
|
|
108
|
-
}
|
|
2
|
+
import { S as SitePongConfig, C as CaptureContext, L as LogLevel, U as User, a as addBreadcrumb } from '../breadcrumbs-DRlJ9h_B.js';
|
|
3
|
+
import { T as TrackProperties, U as UserTraits, G as GroupTraits } from '../types-CLEYbaV8.js';
|
|
4
|
+
export { R as ReplayConfig, a as ReplayEvent } from '../types-CLEYbaV8.js';
|
|
5
|
+
import { DeviceSignals, WebVitals } from '../index.js';
|
|
6
|
+
export { CapturedError, CronCheckinOptions, CronHandle, DatabaseQueryEvent, DatabaseTrackerConfig, ErrorContext, FraudCheckResult, MetricOptions, PerformanceConfig, PerformanceSpan, PerformanceTransaction, ProfileData, ProfileFrame, ProfilerConfig, SitePongConfig, SitePongInitConfig, TraceContext, TracePropagator, VisitorIdResult, areFlagsReady, captureError, captureMessage, clearAnonymousId, createTraceContext, cronCheckin, cronStart, cronWrap, dbTrack, dbTrackSync, endSpan, endTransaction, extractTrace, flush, flushMetrics, flushProfiles, generateSpanId, generateTraceId, getAllFlags, getAnonymousId, getDbNPlusOnePatterns, getDbQueryCount, getDeviceSignals, getFlag, getFraudCheck, getLatestProfile, getProfiles, getReplaySessionId, getVariant, getVariantPayload, getVisitorId, getWebVitals, group, identify, init, isReplayRecording, metricDistribution, metricGauge, metricHistogram, metricIncrement, metricStartTimer, metricTime, profile, propagateTrace, refreshFlags, resetAnalytics, resetDbQueryCount, setAnonymousId, setContext, setTags, setUser, startProfileSpan, startReplay, startSpan, startTransaction, stopReplay, track, trackPageView, waitForFlags } from '../index.js';
|
|
109
7
|
|
|
110
8
|
interface SitePongContextValue {
|
|
111
9
|
isInitialized: boolean;
|
|
@@ -215,11 +113,6 @@ declare class SitePongErrorBoundary extends Component<SitePongErrorBoundaryProps
|
|
|
215
113
|
render(): ReactNode;
|
|
216
114
|
}
|
|
217
115
|
|
|
218
|
-
/**
|
|
219
|
-
* Add a breadcrumb to the trail
|
|
220
|
-
*/
|
|
221
|
-
declare function addBreadcrumb(breadcrumb: Omit<Breadcrumb, "timestamp">): void;
|
|
222
|
-
|
|
223
116
|
/**
|
|
224
117
|
* Hook to access all SitePong SDK methods
|
|
225
118
|
*
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { S as SitePongConfig, C as CaptureContext, L as LogLevel } from '../breadcrumbs-Cydh62b1.mjs';
|
|
2
|
+
export { E as ErrorEvent, a as addBreadcrumb, c as clearBreadcrumbs, g as getBreadcrumbs } from '../breadcrumbs-Cydh62b1.mjs';
|
|
3
|
+
import '../types-CLEYbaV8.mjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Server-side exports for @sitepong/react
|
|
7
|
+
* Use this for Next.js API routes, Express, and other Node.js servers
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Initialize SitePong for server-side usage
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* // In your server entry point or API route
|
|
16
|
+
* import { initServer } from '@sitepong/react/server';
|
|
17
|
+
*
|
|
18
|
+
* initServer({
|
|
19
|
+
* dsn: process.env.SITEPONG_DSN,
|
|
20
|
+
* environment: process.env.NODE_ENV,
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare function initServer(config: SitePongConfig): void;
|
|
25
|
+
/**
|
|
26
|
+
* Get the current server configuration
|
|
27
|
+
*/
|
|
28
|
+
declare function getServerConfig(): SitePongConfig | null;
|
|
29
|
+
/**
|
|
30
|
+
* Capture an exception on the server
|
|
31
|
+
*/
|
|
32
|
+
declare function captureServerException(error: Error | unknown, context?: CaptureContext & {
|
|
33
|
+
request?: {
|
|
34
|
+
url?: string;
|
|
35
|
+
method?: string;
|
|
36
|
+
headers?: Record<string, string>;
|
|
37
|
+
query?: Record<string, string>;
|
|
38
|
+
body?: unknown;
|
|
39
|
+
ip?: string;
|
|
40
|
+
};
|
|
41
|
+
}): Promise<string | null>;
|
|
42
|
+
/**
|
|
43
|
+
* Capture a message on the server
|
|
44
|
+
*/
|
|
45
|
+
declare function captureServerMessage(message: string, level?: LogLevel, context?: CaptureContext): Promise<string | null>;
|
|
46
|
+
|
|
47
|
+
export { CaptureContext, LogLevel, SitePongConfig, captureServerException, captureServerMessage, getServerConfig, initServer };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { S as SitePongConfig, C as CaptureContext, L as LogLevel } from '../breadcrumbs-DRlJ9h_B.js';
|
|
2
|
+
export { E as ErrorEvent, a as addBreadcrumb, c as clearBreadcrumbs, g as getBreadcrumbs } from '../breadcrumbs-DRlJ9h_B.js';
|
|
3
|
+
import '../types-CLEYbaV8.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Server-side exports for @sitepong/react
|
|
7
|
+
* Use this for Next.js API routes, Express, and other Node.js servers
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Initialize SitePong for server-side usage
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* // In your server entry point or API route
|
|
16
|
+
* import { initServer } from '@sitepong/react/server';
|
|
17
|
+
*
|
|
18
|
+
* initServer({
|
|
19
|
+
* dsn: process.env.SITEPONG_DSN,
|
|
20
|
+
* environment: process.env.NODE_ENV,
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare function initServer(config: SitePongConfig): void;
|
|
25
|
+
/**
|
|
26
|
+
* Get the current server configuration
|
|
27
|
+
*/
|
|
28
|
+
declare function getServerConfig(): SitePongConfig | null;
|
|
29
|
+
/**
|
|
30
|
+
* Capture an exception on the server
|
|
31
|
+
*/
|
|
32
|
+
declare function captureServerException(error: Error | unknown, context?: CaptureContext & {
|
|
33
|
+
request?: {
|
|
34
|
+
url?: string;
|
|
35
|
+
method?: string;
|
|
36
|
+
headers?: Record<string, string>;
|
|
37
|
+
query?: Record<string, string>;
|
|
38
|
+
body?: unknown;
|
|
39
|
+
ip?: string;
|
|
40
|
+
};
|
|
41
|
+
}): Promise<string | null>;
|
|
42
|
+
/**
|
|
43
|
+
* Capture a message on the server
|
|
44
|
+
*/
|
|
45
|
+
declare function captureServerMessage(message: string, level?: LogLevel, context?: CaptureContext): Promise<string | null>;
|
|
46
|
+
|
|
47
|
+
export { CaptureContext, LogLevel, SitePongConfig, captureServerException, captureServerMessage, getServerConfig, initServer };
|