@newtalaria/browser 0.1.4 → 0.1.5
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 +30 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/iife.d.ts +2 -0
- package/dist/iife.d.ts.map +1 -0
- package/dist/index.js +8 -2
- package/dist/index.js.map +2 -2
- package/dist/replay/recorder.d.ts +2 -0
- package/dist/replay/recorder.d.ts.map +1 -1
- package/dist/talaria.browser.iife.js +13986 -0
- package/dist/talaria.browser.iife.js.map +7 -0
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -35,6 +35,9 @@ Talaria.init({
|
|
|
35
35
|
// until the 5-minute max duration (Sentry-like, more expensive).
|
|
36
36
|
replaysErrorAfterMs: 15_000,
|
|
37
37
|
maskAllInputs: true, // default
|
|
38
|
+
// Embed same-origin CSS into the snapshot (needed for auth-gated UIs like CMS).
|
|
39
|
+
// Default false — player re-fetches public stylesheet hrefs instead.
|
|
40
|
+
// inlineStylesheet: true,
|
|
38
41
|
});
|
|
39
42
|
|
|
40
43
|
try {
|
|
@@ -52,6 +55,27 @@ await Talaria.close();
|
|
|
52
55
|
|
|
53
56
|
`Talaria.init` also installs `window.onerror` / `unhandledrejection` handlers unless you pass `disableDefaultIntegrations: true`.
|
|
54
57
|
|
|
58
|
+
Optional init `tags` are merged into every captured event (per-call tags win on key conflict).
|
|
59
|
+
|
|
60
|
+
## Script tag (IIFE)
|
|
61
|
+
|
|
62
|
+
For hosts without a bundler (e.g. Silverstripe `Requirements`):
|
|
63
|
+
|
|
64
|
+
```html
|
|
65
|
+
<script src="/path/to/talaria.browser.iife.js"></script>
|
|
66
|
+
<script>
|
|
67
|
+
Talaria.init({
|
|
68
|
+
dsn: 'https://api.example.com',
|
|
69
|
+
apiKey: 'tal_live_…',
|
|
70
|
+
environment: 'production',
|
|
71
|
+
replaysSessionSampleRate: 0,
|
|
72
|
+
replaysOnErrorSampleRate: 0,
|
|
73
|
+
});
|
|
74
|
+
</script>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Build output: `dist/talaria.browser.iife.js` (also produced by `npm run build` / `npm run build:iife`).
|
|
78
|
+
|
|
55
79
|
## Recommended sampling (cost)
|
|
56
80
|
|
|
57
81
|
You pay for **uploaded + retained** bytes, not for local buffering. Prefer error clips in production; keep full-session sampling low.
|
|
@@ -127,6 +151,12 @@ Custom rrweb events:
|
|
|
127
151
|
|
|
128
152
|
Privacy defaults: `maskAllInputs: true`, password fields masked, `[data-talaria-mask]` blocked.
|
|
129
153
|
|
|
154
|
+
### Auth-gated CSS (CMS / admin)
|
|
155
|
+
|
|
156
|
+
By default `inlineStylesheet` is `false`: linked stylesheets stay as `href`s and are re-fetched when you watch the replay. That works for **public** CSS, but fails for login-protected admin CSS (player has no session cookies).
|
|
157
|
+
|
|
158
|
+
Set `inlineStylesheet: true` so same-origin stylesheet rules are embedded while the user is logged in. Cross-origin sheets without CORS still cannot be inlined (browser `cssRules` restriction).
|
|
159
|
+
|
|
130
160
|
## Public API
|
|
131
161
|
|
|
132
162
|
| API | Description |
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,aAAa,EACb,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAoCpB,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,EACnB,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,uBAAuB,EACvB,+BAA+B,EAC/B,+BAA+B,EAC/B,4BAA4B,GAC7B,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd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AE,aAAsB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;IASV,KAAK,CAAC,IAAI,CAAC,EAAE;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB,GAAG,OAAO,CAAC,IAAI,CAAC;IA0CjB;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAmD5B,OAAO,CAAC,YAAY;YAwBN,OAAO;IA+ErB,OAAO,CAAC,iBAAiB;IAkBzB,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,uBAAuB;IAK/B,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,uBAAuB;IAiB/B,OAAO,CAAC,qBAAqB;YAOf,qBAAqB;IAsBnC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAmB5B,OAAO,CAAC,mBAAmB;IAO3B,8EAA8E;YAChE,YAAY;YAgBZ,eAAe;IAW7B,oFAAoF;IACpF,OAAO,CAAC,iBAAiB;IAiBzB,+EAA+E;IAC/E,OAAO,CAAC,oBAAoB;IAI5B;;;OAGG;IACH,OAAO,CAAC,yBAAyB;IAYjC,OAAO,CAAC,uBAAuB;IAc/B,OAAO,CAAC,qBAAqB;IA6B7B,OAAO,CAAC,aAAa;YAKP,aAAa;YAkBb,qBAAqB;IA8HnC,OAAO,CAAC,kBAAkB;IAQ1B;;;OAGG;YACW,iBAAiB;YA2BjB,cAAc;CAuB7B"}
|
package/dist/iife.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iife.d.ts","sourceRoot":"","sources":["../src/iife.ts"],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -13142,7 +13142,7 @@ function startRecorder(options) {
|
|
|
13142
13142
|
blockSelector: defaultBlockSelector(options.blockSelector),
|
|
13143
13143
|
recordCanvas: false,
|
|
13144
13144
|
collectFonts: false,
|
|
13145
|
-
inlineStylesheet:
|
|
13145
|
+
inlineStylesheet: options.inlineStylesheet,
|
|
13146
13146
|
// Shrink DOM snapshots on heavy sites (docs / marketing).
|
|
13147
13147
|
slimDOMOptions: "all",
|
|
13148
13148
|
sampling: {
|
|
@@ -13294,8 +13294,10 @@ function resolveOptions(options) {
|
|
|
13294
13294
|
replaysOnErrorSampleRate: clamp01(options.replaysOnErrorSampleRate ?? 1),
|
|
13295
13295
|
replaysErrorAfterMs: normalizeErrorAfterMs(options.replaysErrorAfterMs),
|
|
13296
13296
|
maskAllInputs: options.maskAllInputs ?? true,
|
|
13297
|
+
inlineStylesheet: options.inlineStylesheet ?? false,
|
|
13297
13298
|
blockSelector: options.blockSelector ?? "",
|
|
13298
13299
|
userId: options.userId,
|
|
13300
|
+
tags: options.tags,
|
|
13299
13301
|
disableDefaultIntegrations: options.disableDefaultIntegrations ?? false
|
|
13300
13302
|
};
|
|
13301
13303
|
}
|
|
@@ -13380,6 +13382,7 @@ var TalariaClient = class {
|
|
|
13380
13382
|
this.uploadEnabled = this.sessionSampled;
|
|
13381
13383
|
this.recorder = startRecorder({
|
|
13382
13384
|
maskAllInputs: this.options.maskAllInputs,
|
|
13385
|
+
inlineStylesheet: this.options.inlineStylesheet,
|
|
13383
13386
|
blockSelector: this.options.blockSelector,
|
|
13384
13387
|
onEvent: (event) => this.onRrwebEvent(event)
|
|
13385
13388
|
});
|
|
@@ -13551,7 +13554,10 @@ var TalariaClient = class {
|
|
|
13551
13554
|
throw error;
|
|
13552
13555
|
}
|
|
13553
13556
|
}
|
|
13554
|
-
const tags = {
|
|
13557
|
+
const tags = {
|
|
13558
|
+
...this.options.tags ?? {},
|
|
13559
|
+
...args.context?.tags ?? {}
|
|
13560
|
+
};
|
|
13555
13561
|
const extra = args.context?.extra;
|
|
13556
13562
|
const replayId = this.uploadEnabled && this.segmentIndex > 0 ? this.replayId : this.linkableReplayId;
|
|
13557
13563
|
try {
|