@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 CHANGED
@@ -1,3 +1,14 @@
1
+ ## 2.7.0 (2025-05-05)
2
+
3
+ 🚀 Features
4
+ Add Web Worker error handling.
5
+
6
+ ## 2.6.0 (2025-05-04)
7
+
8
+ ### 🚀 Features
9
+
10
+ - Add NPM compatibility for old browsers
11
+
1
12
  ## 2.5.0 (2025-04-29)
2
13
 
3
14
  ### 🚀 Features
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>