You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### (Optional) Attach User Information or Metadata
24
-
25
-
Attaching user information will allow you to search/filter sessions and events in HyperDX. This can be called at any point during the client session. The current client session and all events sent after the call will be associated with the user information.
26
-
27
-
`userEmail`, `userName`, and `teamName` will populate the sessions UI with the corresponding values, but can be omitted. Any other additional values can be specified and used to search for events.
23
+
#### Options
24
+
25
+
-`apiKey` - Your HyperDX Ingestion API Key.
26
+
-`service` - The service name events will show up as in HyperDX.
27
+
-`tracePropagationTargets` - A list of regex patterns to match against HTTP
28
+
requests to link frontend and backend traces, it will add an additional
29
+
`traceparent` header to all requests matching any of the patterns. This should
30
+
be set to your backend API domain (ex. `api.yoursite.com`).
31
+
-`consoleCapture` - (Optional) Capture all console logs (default `false`).
32
+
-`advancedNetworkCapture` - (Optional) Capture full request/response headers
33
+
and bodies (default false).
34
+
-`url` - (Optional) The OpenTelemetry collector URL, only needed for
35
+
self-hosted instances.
36
+
-`maskAllInputs` - (Optional) Whether to mask all input fields in session
37
+
replay (default `false`).
38
+
-`maskAllText` - (Optional) Whether to mask all text in session replay (default
39
+
`false`).
40
+
-`disableIntercom` - (Optional) Whether to disable Intercom integration (default `false`)
41
+
-`disableReplay` - (Optional) Whether to disable session replay (default `false`)
42
+
-`recordCanvas` - (Optional) Whether to record canvas elements (default `false`)
43
+
-`sampling` - (Optional) The sampling [config](https://github.com/rrweb-io/rrweb/blob/5fbb904edb653f3da17e6775ee438d81ef0bba83/docs/recipes/optimize-storage.md?plain=1#L22) in the session recording
44
+
45
+
## Additional Configuration
46
+
47
+
### Attach User Information or Metadata
48
+
49
+
Attaching user information will allow you to search/filter sessions and events
50
+
in HyperDX. This can be called at any point during the client session. The
51
+
current client session and all events sent after the call will be associated
52
+
with the user information.
53
+
54
+
`userEmail`, `userName`, and `teamName` will populate the sessions UI with the
55
+
corresponding values, but can be omitted. Any other additional values can be
56
+
specified and used to search for events.
28
57
29
58
```js
30
59
HyperDX.setGlobalAttributes({
60
+
userId:user.id,
31
61
userEmail:user.email,
32
62
userName:user.name,
33
63
teamName:user.team.name,
34
64
// Other custom properties...
35
65
});
36
66
```
37
67
38
-
### (Optional) Send Custom Actions
68
+
### Auto Capture React Error Boundary Errors
69
+
70
+
If you're using React, you can automatically capture errors that occur within
71
+
React error boundaries by passing your error boundary component
72
+
into the `attachToReactErrorBoundary` function.
39
73
40
-
To explicitly track a specific application event (ex. sign up, submission, etc.), you can call the `addAction` function with an event name and optional event metadata.
74
+
```js
75
+
// Import your ErrorBoundary (we're using react-error-boundary as an example)
To enable or disable network capture dynamically, simply invoke the `enableAdvancedNetworkCapture` or `disableAdvancedNetworkCapture` function as needed.
101
+
To enable or disable network capture dynamically, simply invoke the
102
+
`enableAdvancedNetworkCapture` or `disableAdvancedNetworkCapture` function as
103
+
needed.
55
104
56
105
```js
57
106
HyperDX.enableAdvancedNetworkCapture();
58
107
```
59
108
60
-
### (Optional) React ErrorBoundary Integration
109
+
### Stop/Resume Session Recorder Dynamically
61
110
62
-
To enable automatic error tracking with ErrorBoundary, simply attach the HyperDX error handler to the ErrorBoundary component.
111
+
To stop or resume session recording dynamically, simply invoke the
112
+
`resumeSessionRecorder` or `stopSessionRecorder` function as needed.
0 commit comments