@coralogix/browser 3.23.6 → 4.0.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 +51 -0
- package/LICENSE +65 -0
- package/README.md +28 -1
- package/index.esm.js +2 -2
- package/index.esm2.js +3064 -3306
- package/package.json +14 -11
- package/sessionRecorder.esm.js +2295 -2711
- package/src/constants.d.ts +4 -1
- package/src/custom-spans/custom-spans.utils.d.ts +1 -2
- package/src/helpers.d.ts +2 -0
- package/src/instrumentations/network/constants.d.ts +5 -0
- package/src/instrumentations/network/network.utils.d.ts +3 -0
- package/src/instrumentations/screenshot/dom-change-screenshot-trigger.d.ts +28 -0
- package/src/instrumentations/screenshot/dom-change-screenshot.consts.d.ts +23 -0
- package/src/instrumentations/screenshot/screenshot-gate.d.ts +1 -0
- package/src/instrumentations/screenshot/screenshot.utils.d.ts +2 -0
- package/src/instrumentations/user-interaction/user-interaction.utils.d.ts +2 -2
- package/src/otel/rum-span-attributes.types.d.ts +1 -0
- package/src/session/session.model.d.ts +1 -0
- package/src/session/sessionRecorder.d.ts +1 -0
- package/src/tools/cx-shimmer.d.ts +2 -0
- package/src/types.d.ts +6 -8
- package/src/version.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,54 @@
|
|
|
1
|
+
# 4.0.0 (2026-09-27)
|
|
2
|
+
|
|
3
|
+
### ⚠️ Breaking Changes
|
|
4
|
+
|
|
5
|
+
- The npm package is now published as ES2022 instead of ES5. If you support browsers older than ES2022, transpile `@coralogix/browser` as part of your own build, or load the ES5 CDN bundle instead — that bundle is unchanged
|
|
6
|
+
- The default CDN bundle is now built to ES2022, up from ES2015. Use the ES5 CDN bundle if you support older browsers
|
|
7
|
+
- The HTTP attributes on network spans are renamed onto the stable OpenTelemetry semantic conventions: `http.method` → `http.request.method`, `http.url` → `url.full`, `http.status_code` → `http.response.status_code`, `http.host` → `server.address`. This affects you only if you read the raw OpenTelemetry span attributes, which reach you through a `tracesExporter` callback. `network_request_context` — what `beforeSend` receives — keeps the same fields and values, apart from `status_text` below
|
|
8
|
+
- `status_text` now reports the standard reason phrase for the status code — `Service Unavailable` for 503 — rather than the phrase the server sent, because HTTP/2 and HTTP/3 carry no reason phrase on the wire at all
|
|
9
|
+
- `response_content_length` is now a `number` instead of a `string`
|
|
10
|
+
|
|
11
|
+
### 🚀 Features
|
|
12
|
+
|
|
13
|
+
- Upgrade OpenTelemetry to 2.x, moving network spans onto the stable HTTP semantic conventions
|
|
14
|
+
- Report `response_content_length` from the `Content-Length` header, so cross-origin requests are now covered; it is unset when the server omits the header
|
|
15
|
+
|
|
16
|
+
### 🩹 Fixes
|
|
17
|
+
|
|
18
|
+
- Report a `status_text` for XHR requests that fail outright — offline, blocked by CORS, aborted or timed out — where it was previously left empty. XHR carries no reason for such a failure, so these report `Unknown`; a failed `fetch` reports the browser's own message, as before
|
|
19
|
+
- Ignore a malformed `Content-Length` header instead of reporting a misleading response size
|
|
20
|
+
|
|
21
|
+
## 3.24.0 (2026-09-23)
|
|
22
|
+
|
|
23
|
+
### 🚀 Features
|
|
24
|
+
|
|
25
|
+
- Take an extra screenshot for Coralogix Product Analytics when a user action leads to a meaningful application state — a dialog, drawer or menu opening, a view being replaced — on top of the screenshots already taken on the first click and one random later click of each view. On by default whenever session recording is running; set `sessionRecordingConfig.captureScreenshotOnDomChange: false` to turn it off. Expect a small rise in upload volume: one to four extra screenshots per page view, measured on real applications
|
|
26
|
+
- List the actions available on the captured view in each Product Analytics screenshot event (`screenshot_context.actions`, up to 100 names): the page's `data-cx-action-name` values first, then the same names a click on the page's controls would report as `resolved_name`
|
|
27
|
+
|
|
28
|
+
### 🩹 Fixes
|
|
29
|
+
|
|
30
|
+
- In `onlyWithErrorConfig` mode, hold automatic Product Analytics screenshots until the session has an error. Previously the screenshot payload was uploaded straight away while the event describing it was withheld, so sessions that never errored paid for screenshots that could not be queried
|
|
31
|
+
|
|
32
|
+
## 3.23.8 (2026-09-17)
|
|
33
|
+
|
|
34
|
+
### 🩹 Fixes
|
|
35
|
+
|
|
36
|
+
- Report a clicked button's own text as its interaction name (`resolved_name`) when the button sits inside a container that has an `aria-label`, such as a `role="dialog"` panel. The container's label was reported instead
|
|
37
|
+
- Name a click on an SVG chart shape by the shape's own `<text>` label instead of by the text of the whole page section around the chart
|
|
38
|
+
- Stop naming an icon-only control after the labels of the other buttons in its toolbar; such controls now take their `title` or `alt` attribute, and report no name when they have neither
|
|
39
|
+
- Name a `<select>` by its first option instead of by all its options joined together, and name `<input type="submit">`, `"button"` and `"reset"` by their `value`
|
|
40
|
+
- Exclude text under a masked element (`maskClass`) from `resolved_name` instead of leaking it when the clicked control contains masked content
|
|
41
|
+
- Cap `resolved_name` and `element_inner_text` at 100 characters, ending with ` [...]` when cut, so a container's content can no longer produce a very long interaction name
|
|
42
|
+
- Run only the first SDK copy loaded on a page: a second copy (another bundle importing the SDK, or a CDN script next to an npm install) no longer replaces `window.CoralogixRum`, and its `init` is ignored with a debug message
|
|
43
|
+
|
|
44
|
+
## 3.23.7 (2026-09-14)
|
|
45
|
+
|
|
46
|
+
### 🩹 Fixes
|
|
47
|
+
|
|
48
|
+
- Mask a page URL segment as `{id}` only when the whole segment is digits, so route names such as `/apm-v2` and `/oauth2` keep their real value
|
|
49
|
+
- Run your own `pageUrlBlueprinters` after the built-in ID masking, so the SDK defaults no longer overwrite them
|
|
50
|
+
- Keep the fragment when masking a numeric segment: `/user/123#details` now reports as `/user/{id}#details`
|
|
51
|
+
|
|
1
52
|
## 3.23.6 (2026-09-09)
|
|
2
53
|
|
|
3
54
|
### 🩹 Fixes
|
package/LICENSE
CHANGED
|
@@ -199,3 +199,68 @@
|
|
|
199
199
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
200
|
See the License for the specific language governing permissions and
|
|
201
201
|
limitations under the License.
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
================================================================================
|
|
205
|
+
THIRD-PARTY NOTICES
|
|
206
|
+
================================================================================
|
|
207
|
+
|
|
208
|
+
This distribution contains code derived from the projects below. Their notices
|
|
209
|
+
are reproduced here as their licenses require for binary distribution; the code
|
|
210
|
+
itself is vendored into this package rather than installed as a dependency.
|
|
211
|
+
|
|
212
|
+
--------------------------------------------------------------------------------
|
|
213
|
+
shimmer 1.2.1 — https://github.com/othiym23/shimmer
|
|
214
|
+
Vendored at src/tools/cx-shimmer.ts
|
|
215
|
+
--------------------------------------------------------------------------------
|
|
216
|
+
|
|
217
|
+
Copyright (c) 2013-2019, Forrest L Norvell
|
|
218
|
+
All rights reserved.
|
|
219
|
+
|
|
220
|
+
Redistribution and use in source and binary forms, with or without
|
|
221
|
+
modification, are permitted provided that the following conditions are met:
|
|
222
|
+
|
|
223
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
224
|
+
list of conditions and the following disclaimer.
|
|
225
|
+
|
|
226
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
227
|
+
this list of conditions and the following disclaimer in the documentation
|
|
228
|
+
and/or other materials provided with the distribution.
|
|
229
|
+
|
|
230
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
231
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
232
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
233
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
234
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
235
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
236
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
237
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
238
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
239
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
240
|
+
|
|
241
|
+
--------------------------------------------------------------------------------
|
|
242
|
+
rrweb — https://github.com/rrweb-io/rrweb
|
|
243
|
+
Vendored at src/cx-rrweb/
|
|
244
|
+
--------------------------------------------------------------------------------
|
|
245
|
+
|
|
246
|
+
MIT License
|
|
247
|
+
|
|
248
|
+
Copyright (c) 2018 Contributors (https://github.com/rrweb-io/rrweb/graphs/contributors)
|
|
249
|
+
|
|
250
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
251
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
252
|
+
in the Software without restriction, including without limitation the rights
|
|
253
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
254
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
255
|
+
furnished to do so, subject to the following conditions:
|
|
256
|
+
|
|
257
|
+
The above copyright notice and this permission notice shall be included in all
|
|
258
|
+
copies or substantial portions of the Software.
|
|
259
|
+
|
|
260
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
261
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
262
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
263
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
264
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
265
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
266
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -96,6 +96,13 @@
|
|
|
96
96
|
JavaScript / TypeScript Frameworks: React, Angular, Vue, NextJS and more.<br>
|
|
97
97
|
Flutter (Currently only web).
|
|
98
98
|
|
|
99
|
+
### JavaScript language level
|
|
100
|
+
|
|
101
|
+
Version 4.0.0 and later publish the npm package as **ES2022**. Versions up to 3.24.0 published ES5.
|
|
102
|
+
|
|
103
|
+
If you support browsers older than ES2022, transpile the package as part of your own build, or load
|
|
104
|
+
the [ES5](#es5) CDN bundle instead.
|
|
105
|
+
|
|
99
106
|
## Usage
|
|
100
107
|
|
|
101
108
|
To use Coralogix SDK for Browsers, call `CoralogixRum.init(options)` at the soonest available moment after the page load.
|
|
@@ -352,6 +359,18 @@ CoralogixRum.init({
|
|
|
352
359
|
recordConsoleEvents: true, // Will record all console events from dev tools. Levels: log, debug, warn, error, info, table etc..
|
|
353
360
|
sessionRecordingSampleRate: 100, // Percentage of overall sessions recording being tracked, defaults to 100% and applied after the overall sessionSampleRate.
|
|
354
361
|
immediateFlush: false, // Flush recording events immediately on start to capture short-duration sessions (<10s). Defaults to false.
|
|
362
|
+
/**
|
|
363
|
+
* Take an extra screenshot when the page changes in a way that looks like a meaningful
|
|
364
|
+
* application state, such as a dialog opening or a view being replaced. These are in addition
|
|
365
|
+
* to the screenshots taken on the first click and one random later click of each view.
|
|
366
|
+
*
|
|
367
|
+
* On by default whenever session recording is running. Detection reads the session recorder's
|
|
368
|
+
* event stream, so with autoStartSessionRecording: false it stays dormant until you call
|
|
369
|
+
* CoralogixRum.startSessionRecording(). Set it to false to turn it off.
|
|
370
|
+
*
|
|
371
|
+
* Available from version 3.24.0.
|
|
372
|
+
**/
|
|
373
|
+
captureScreenshotOnDomChange: true, // Defaults to true.
|
|
355
374
|
},
|
|
356
375
|
});
|
|
357
376
|
```
|
|
@@ -702,6 +721,13 @@ CoralogixRum.init({
|
|
|
702
721
|
});
|
|
703
722
|
```
|
|
704
723
|
|
|
724
|
+
The SDK applies its own built-in blueprinting first, then your functions, in the order you list
|
|
725
|
+
them, so your blueprinter has the final word on the URL it returns.
|
|
726
|
+
|
|
727
|
+
The built-in page blueprinting replaces UUIDs and all-digit path segments with `{id}`, so
|
|
728
|
+
`/orders/1234` becomes `/orders/{id}`. A segment that only happens to contain a digit keeps its
|
|
729
|
+
real value, which leaves route names such as `/apm-v2`, `/oauth2` and `/v1` untouched.
|
|
730
|
+
|
|
705
731
|
### Traces
|
|
706
732
|
|
|
707
733
|
Add trace context propagation in headers across service boundaries
|
|
@@ -1282,7 +1308,8 @@ You can choose your desired version.
|
|
|
1282
1308
|
|
|
1283
1309
|
#### Specific Version (recommended)
|
|
1284
1310
|
|
|
1285
|
-
|
|
1311
|
+
From 4.0.0 the default bundle is built to the <b>ES2022</b> standard, up from ES2015. If you support
|
|
1312
|
+
older environments, use the [ES5](#es5) bundle below.
|
|
1286
1313
|
|
|
1287
1314
|
https://cdn.rum-ingress-coralogix.com/coralogix/browser/[version]/coralogix-browser-sdk.js \
|
|
1288
1315
|
Replace [version] with a version from [Releases page](https://www.npmjs.com/package/@coralogix/browser?activeTab=versions).
|
package/index.esm.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import 'tslib';
|
|
1
|
+
export { x as CoralogixEventType, v as CoralogixLogSeverity, u as CoralogixRum, O as OtelNetworkAttrs, y as PerformanceTypes, w as SessionRecordingEventType, U as UrlBasedLabelProvider, z as UrlType } from './index.esm2.js';
|
|
3
2
|
import '@opentelemetry/sdk-trace-base';
|
|
4
3
|
import '@opentelemetry/sdk-trace-web';
|
|
5
4
|
import '@opentelemetry/instrumentation';
|
|
@@ -8,6 +7,7 @@ import '@opentelemetry/instrumentation-fetch';
|
|
|
8
7
|
import '@opentelemetry/instrumentation-xml-http-request';
|
|
9
8
|
import 'web-vitals/attribution';
|
|
10
9
|
import 'web-vitals';
|
|
10
|
+
import '@opentelemetry/core';
|
|
11
11
|
import '@opentelemetry/api';
|
|
12
12
|
import '@opentelemetry/propagator-b3';
|
|
13
13
|
import '@opentelemetry/propagator-aws-xray';
|