testchimp-rum-js 0.0.5 → 0.0.6
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 +14 -12
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -49,11 +49,11 @@ Initializes the RUM client. Call once before using `emit`, `flush`, or `resetSes
|
|
|
49
49
|
|-----------|------|----------|--------------|
|
|
50
50
|
| `config.projectId` | `string` | Yes | TestChimp project ID. |
|
|
51
51
|
| `config.apiKey` | `string` | Yes | TestChimp API key for this project. |
|
|
52
|
+
| `config.environment` | `string` | Yes | Logical environment for the session (e.g. `'production'`, `'staging'`). |
|
|
52
53
|
| `config.sessionId` | `string` | No | Override session ID (otherwise derived from `localStorage` or generated). |
|
|
53
|
-
| `config.environment` | `string` | No | Logical environment for the session (e.g. `'production'`, `'staging'`). |
|
|
54
54
|
| `config.release` | `string` | No | Application release/version identifier (e.g. `'2.1.0'`). |
|
|
55
55
|
| `config.branchName` | `string` | No | Git branch name associated with this session (e.g. `'feature/checkout'`). |
|
|
56
|
-
| `config.sessionMetadata` | `Struct` | No | Additional immutable metadata for the session (same validation as event metadata). Do **not** put `environment`, `release`, or `
|
|
56
|
+
| `config.sessionMetadata` | `Struct` | No | Additional immutable metadata for the session (same validation as event metadata). Do **not** put `environment`, `release`, or `branchName` here—use the top-level fields above. |
|
|
57
57
|
| `config.config` | `object` | No | Optional tuning; see [Configuration options](#configuration-options). |
|
|
58
58
|
|
|
59
59
|
**Example with options**
|
|
@@ -128,7 +128,7 @@ Pass these under `config` in `init()`:
|
|
|
128
128
|
| Option | Type | Default | Description |
|
|
129
129
|
|--------|------|--------|-------------|
|
|
130
130
|
| `captureEnabled` | `boolean` | `true` | If `false`, `emit` is a no-op. |
|
|
131
|
-
| `enableDefaultSessionMetadata` | `boolean` | `true` |
|
|
131
|
+
| `enableDefaultSessionMetadata` | `boolean` | `true` | When `true` (default), the session init request is automatically populated with client-derived metadata (browser, device type, OS, language, timezone). Set to `false` to disable and send only your own `sessionMetadata`. |
|
|
132
132
|
| `maxEventsPerSession` | `number` | `100` | Max events accepted per session (by title count + repeats). |
|
|
133
133
|
| `maxRepeatsPerEvent` | `number` | `3` | Max number of events with the same `title` per session. |
|
|
134
134
|
| `eventSendInterval` | `number` | `10000` | Interval (ms) for sending buffered events. |
|
|
@@ -136,19 +136,21 @@ Pass these under `config` in `init()`:
|
|
|
136
136
|
| `inactivityTimeoutMillis` | `number` | `1800000` (30 min) | Session considered expired after this much inactivity; next load gets a new session. |
|
|
137
137
|
| `testchimpEndpoint` | `string` | `'https://ingress.testchimp.io'` | Base URL for RUM API (session start and events). |
|
|
138
138
|
|
|
139
|
-
**Default session metadata**
|
|
139
|
+
**Default session metadata (updated behaviour)**
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
- **Config:** `enableDefaultSessionMetadata` under `config` in `init()`.
|
|
142
|
+
- **Default value:** `true`. Session init requests are automatically populated with the metadata below unless you set it to `false`.
|
|
143
|
+
- **What gets populated:** When enabled, the **session init** request (only) includes the following client-derived keys in `metadata`. They are computed in the browser from `navigator` and `Intl`; you do not need to pass them. User-provided `sessionMetadata` overrides any of these if you use the same key name.
|
|
142
144
|
|
|
143
|
-
| Key |
|
|
144
|
-
|
|
145
|
-
| `_browser` | Browser name only
|
|
145
|
+
| Key | Populated with |
|
|
146
|
+
|-----|----------------|
|
|
147
|
+
| `_browser` | Browser name only (e.g. Chrome, Firefox, Edge, Safari). No version. |
|
|
146
148
|
| `_device_type` | One of: `desktop`, `mobile`, `tablet`. |
|
|
147
|
-
| `_os` | Normalized OS
|
|
148
|
-
| `_language` | Browser language
|
|
149
|
-
| `_timezone` | IANA timezone
|
|
149
|
+
| `_os` | Normalized OS (e.g. mac, windows, linux, ios, android). |
|
|
150
|
+
| `_language` | Browser language (e.g. en-US). |
|
|
151
|
+
| `_timezone` | IANA timezone (e.g. America/New_York). |
|
|
150
152
|
|
|
151
|
-
These are
|
|
153
|
+
These fields are added **only to the session init** call (`/rum/session/start`). Individual `emit()` calls are unchanged and do not include this metadata.
|
|
152
154
|
|
|
153
155
|
**Example: high-frequency sampling**
|
|
154
156
|
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AAOlC,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AAOlC,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE;QACP,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,4BAA4B,CAAC,EAAE,OAAO,CAAC;QACvC,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;CACH;AAsCD,wBAAgB,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAqF7C;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAkB3C;AAED,wBAAgB,KAAK,IAAI,IAAI,CAI5B;AAED,wBAAgB,YAAY,IAAI,MAAM,CAKrC;AAED,wBAAgB,YAAY,IAAI,IAAI,CAgBnC;AAGD,QAAA,MAAM,SAAS;;;;;;CAMd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testchimp-rum-js",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Lightweight browser library for emitting structured user interaction events to TestChimp",
|
|
3
|
+
"version": "0.0.6",
|
|
4
|
+
"description": "Lightweight browser library for emitting structured user interaction events to TestChimp - for test coverage analytics grounded in real user behaviour",
|
|
5
5
|
"main": "dist/testchimp-rum.min.js",
|
|
6
6
|
"module": "dist/testchimp-rum.mjs",
|
|
7
7
|
"unpkg": "dist/testchimp-rum.min.js",
|