@groundcover/browser 0.0.16 → 0.0.17
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/README.md +94 -0
- package/package.json +4 -4
package/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# groundcover RUM Browser Monitoring
|
|
2
|
+
|
|
3
|
+
groundcover’s Real User Monitoring (RUM) SDK allows you to capture front-end performance data, user events, and errors from your web applications.
|
|
4
|
+
|
|
5
|
+
See the dedicated [groundcover documentation](https://docs.groundcover.com/capabilities/real-user-monitoring-rum/) for more details.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @groundcover/browser
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Initialize the SDK
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import groundcover from "@groundcover/browser";
|
|
17
|
+
|
|
18
|
+
groundcover.init({
|
|
19
|
+
apiKey: "your-api-key",
|
|
20
|
+
cluster: "your-cluster",
|
|
21
|
+
environment: "production",
|
|
22
|
+
dsn: "your-dsn",
|
|
23
|
+
appId: "your-app-id",
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Identify users
|
|
28
|
+
|
|
29
|
+
Link RUM data to specific users:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
groundcover.identifyUser({
|
|
33
|
+
id: "John Doe",
|
|
34
|
+
email: "john@groundcover.com",
|
|
35
|
+
organization: "groundcover",
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Send custom events
|
|
40
|
+
|
|
41
|
+
Send custom events to groundcover:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
groundcover.track("custom-event");
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Capture errors
|
|
48
|
+
|
|
49
|
+
Capture errors from your web application:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
groundcover.captureException("error");
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Optional Configuration
|
|
56
|
+
|
|
57
|
+
You can customize SDK behavior (event sampling, data masking, enabled events). The following properties are customizable:
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
export interface SDKOptions {
|
|
61
|
+
batchSize: number;
|
|
62
|
+
batchTimeout: number;
|
|
63
|
+
eventSampleRate: number;
|
|
64
|
+
sessionSampleRate: number;
|
|
65
|
+
environment: string;
|
|
66
|
+
debug: boolean;
|
|
67
|
+
tracePropagationUrls: string[];
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
You can pass the values by calling the init function:
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
groundcover.init({
|
|
75
|
+
apiKey: "your-api-key",
|
|
76
|
+
cluster: "your-cluster",
|
|
77
|
+
environment: "production",
|
|
78
|
+
dsn: "your-dsn",
|
|
79
|
+
appId: "your-app-id",
|
|
80
|
+
options: {
|
|
81
|
+
batchSize: 50,
|
|
82
|
+
sessionSampleRate: 0.5, // 50% sessions sampled
|
|
83
|
+
eventsSampleRate: 0.5,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Or via the updateConfig function:
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
groundcover.updateConfig({
|
|
92
|
+
batchSize: 20,
|
|
93
|
+
});
|
|
94
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@groundcover/browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"description": "groundcover browser SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|
|
32
|
-
"url": "git+https://github.com/groundcover-com/
|
|
32
|
+
"url": "git+https://github.com/groundcover-com/browser.git"
|
|
33
33
|
},
|
|
34
34
|
"keywords": [
|
|
35
35
|
"rum",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"author": "groundcover",
|
|
39
39
|
"license": "MIT",
|
|
40
40
|
"bugs": {
|
|
41
|
-
"url": "https://github.com/groundcover-com/
|
|
41
|
+
"url": "https://github.com/groundcover-com/browser/issues"
|
|
42
42
|
},
|
|
43
|
-
"homepage": "https://github.com/groundcover-com/
|
|
43
|
+
"homepage": "https://github.com/groundcover-com/browser#readme",
|
|
44
44
|
"packageManager": "pnpm@9.15.0+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c",
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@eslint/js": "^9.19.0",
|