@coralogix/browser 2.5.0 → 2.7.0
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/CHANGELOG.md +11 -0
- package/README.md +47 -0
- package/index.esm2.js +690 -605
- package/package.json +1 -1
- package/sessionRecorder.esm.js +666 -582
- package/src/constants.d.ts +6 -1
- package/src/coralogix-rum.d.ts +4 -0
- package/src/instrumentations/CoralogixErrorInstrumentation.d.ts +2 -1
- package/src/instrumentations/instrumentation.consts.d.ts +6 -0
- package/src/instrumentations/web-worker/CoralogixWorkerInstrumentation.d.ts +14 -0
- package/src/instrumentations/web-worker/web-worker.consts.d.ts +12 -0
- package/src/types.d.ts +10 -0
- package/src/utils/compatibility.d.ts +1 -0
- package/src/version.d.ts +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -839,6 +839,53 @@ You can also manually trigger memory usage data collection.
|
|
|
839
839
|
CoralogixRum.measureUserAgentSpecificMemory();
|
|
840
840
|
```
|
|
841
841
|
|
|
842
|
+
## Web Worker Support
|
|
843
|
+
|
|
844
|
+
Web Worker support enables the capture of events originating from Web Workers, including unhandled errors, custom logs, and other functionalities provided by the SDK.
|
|
845
|
+
|
|
846
|
+
> By default, Web Worker support is **disabled**.
|
|
847
|
+
|
|
848
|
+
---
|
|
849
|
+
|
|
850
|
+
### Enabling Web Worker Support
|
|
851
|
+
|
|
852
|
+
```javascript
|
|
853
|
+
CoralogixRum.init({
|
|
854
|
+
workerSupport: true,
|
|
855
|
+
});
|
|
856
|
+
```
|
|
857
|
+
|
|
858
|
+
---
|
|
859
|
+
|
|
860
|
+
#### Examples
|
|
861
|
+
|
|
862
|
+
```javascript
|
|
863
|
+
// App code – creating a worker. The SDK will automatically capture errors from it.
|
|
864
|
+
|
|
865
|
+
const worker = new Worker('my-worker.js');
|
|
866
|
+
```
|
|
867
|
+
|
|
868
|
+
```javascript
|
|
869
|
+
// Worker code
|
|
870
|
+
|
|
871
|
+
// Log a basic info log
|
|
872
|
+
worker.CoralogixRum.log(CoralogixLogSeverity.Info, 'Test log from worker');
|
|
873
|
+
|
|
874
|
+
// Manually capture errors
|
|
875
|
+
try {
|
|
876
|
+
// Some code that might throw an error
|
|
877
|
+
} catch (error) {
|
|
878
|
+
worker.CoralogixRum.captureError(error, { worker: 'analytics-worker' }, { label1: 'value1' });
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
// Log messages received in the worker
|
|
882
|
+
self.onmessage = (message) => {
|
|
883
|
+
worker.CoralogixRum.log(CoralogixLogSeverity.Info, message);
|
|
884
|
+
};
|
|
885
|
+
```
|
|
886
|
+
|
|
887
|
+
---
|
|
888
|
+
|
|
842
889
|
## CDN
|
|
843
890
|
|
|
844
891
|
Coralogix Browser SDK is also provided via CDN.<br>
|