@flareapp/js 2.9.0 → 2.10.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/README.md +43 -0
- package/dist/browser.cjs +1 -1
- package/dist/browser.mjs +1 -1
- package/dist/{catchWindowErrors-C0gSVGiF.mjs → catchWindowErrors-CkFI5Vwv.mjs} +1 -1
- package/dist/{catchWindowErrors-cR2D7kju.cjs → catchWindowErrors-zf246a2G.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -37,6 +37,49 @@ flare.setUser({
|
|
|
37
37
|
|
|
38
38
|
Recognised fields: `id` (→ `user.id`), `email` (→ `user.email`), `fullName` (→ `user.full_name`), `ipAddress` (→ `client.address`). Any extra keys are collected under `user.attributes`. Pass `null` to clear the user on logout: `flare.setUser(null)`.
|
|
39
39
|
|
|
40
|
+
## Cookie consent and GDPR
|
|
41
|
+
|
|
42
|
+
The client can run behind a consent tool. When consent is off, it sends nothing. Before consent, it does not even assemble a report.
|
|
43
|
+
|
|
44
|
+
The switch is one method:
|
|
45
|
+
|
|
46
|
+
```javascript
|
|
47
|
+
flare.setConsent(true); // allow sending
|
|
48
|
+
flare.setConsent(false); // stop sending, and drop anything captured earlier
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Recommended flow: do not call `flare.light(key)` until consent is granted. With no key, nothing sends, so this covers the moment before your consent code runs. Use `setConsent` for withdrawal and re-grant, because once the key is set it is the only clean off switch.
|
|
52
|
+
|
|
53
|
+
```javascript
|
|
54
|
+
import { flare } from '@flareapp/js';
|
|
55
|
+
|
|
56
|
+
// Cookiebot example. OneTrust exposes OptanonWrapper; the idea is the same.
|
|
57
|
+
window.addEventListener('CookiebotOnAccept', () => {
|
|
58
|
+
flare.light('your-project-key'); // first grant: start the client
|
|
59
|
+
flare.setConsent(true); // and allow sending
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
window.addEventListener('CookiebotOnDecline', () => {
|
|
63
|
+
flare.setConsent(false); // withdrawal: stop all sends, drop buffers
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
If you set the key at boot instead of waiting, start with consent off, then turn it on when the user accepts:
|
|
68
|
+
|
|
69
|
+
```javascript
|
|
70
|
+
import { flare } from '@flareapp/js';
|
|
71
|
+
|
|
72
|
+
flare.configure({ hasConsent: false }); // start off, before anything can send
|
|
73
|
+
flare.light('your-project-key');
|
|
74
|
+
|
|
75
|
+
window.addEventListener('CookiebotOnAccept', () => flare.setConsent(true));
|
|
76
|
+
window.addEventListener('CookiebotOnDecline', () => flare.setConsent(false));
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Put `configure({ hasConsent: false })` first, right after the import, so the gate is off before an early uncaught error can assemble a report.
|
|
80
|
+
|
|
81
|
+
Consent defaults to on, so setups without a consent tool are unchanged. `setConsent(false)` stops data leaving the browser. It does not remove the `fetch` and `XHR` patches that tracing and breadcrumbs install, because those only read in memory and never send on their own. To remove those too, call `flare.configure({ enableTracing: false, enableBreadcrumbs: false })`.
|
|
82
|
+
|
|
40
83
|
## Logging
|
|
41
84
|
|
|
42
85
|
Beyond errors, the client can send structured logs. Logs are opt-in: enable them with `enableLogs`, then call any of
|
package/dist/browser.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_catchWindowErrors = require('./catchWindowErrors-
|
|
2
|
+
const require_catchWindowErrors = require('./catchWindowErrors-zf246a2G.cjs');
|
|
3
3
|
let _flareapp_core = require("@flareapp/core");
|
|
4
4
|
|
|
5
5
|
//#region src/browser.ts
|
package/dist/browser.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as currentHref, D as absoluteHref, E as routeName, O as absoluteUrl, S as registerNavigationSource, T as resolveHref, _ as BrowserFlushScheduler, a as recordComponentSpan, b as browserUrlContext, c as startBrowserTracing, d as instrumentOnce, f as insulate, g as collectBrowser, h as FetchFileReader, i as nowNano, l as stopBrowserTracing, m as CLIENT_VERSION, n as createFlareResolver, o as reserveSpanId, p as safeInvoke, r as activeComponentRoot, s as resolveComponentParent, t as catchWindowErrors, u as BrowserSpanType, v as startBreadcrumbs, w as currentPath, x as withRequestPatches, y as traceRequests } from "./catchWindowErrors-
|
|
1
|
+
import { C as currentHref, D as absoluteHref, E as routeName, O as absoluteUrl, S as registerNavigationSource, T as resolveHref, _ as BrowserFlushScheduler, a as recordComponentSpan, b as browserUrlContext, c as startBrowserTracing, d as instrumentOnce, f as insulate, g as collectBrowser, h as FetchFileReader, i as nowNano, l as stopBrowserTracing, m as CLIENT_VERSION, n as createFlareResolver, o as reserveSpanId, p as safeInvoke, r as activeComponentRoot, s as resolveComponentParent, t as catchWindowErrors, u as BrowserSpanType, v as startBreadcrumbs, w as currentPath, x as withRequestPatches, y as traceRequests } from "./catchWindowErrors-CkFI5Vwv.mjs";
|
|
2
2
|
import { Api, Flare as Flare$1, FrameworkName, GlobalScopeProvider } from "@flareapp/core";
|
|
3
3
|
|
|
4
4
|
//#region src/browser.ts
|
|
@@ -1056,7 +1056,7 @@ var FetchFileReader = class {
|
|
|
1056
1056
|
|
|
1057
1057
|
//#endregion
|
|
1058
1058
|
//#region src/env/index.ts
|
|
1059
|
-
const CLIENT_VERSION = typeof process !== "undefined" && true ? "2.
|
|
1059
|
+
const CLIENT_VERSION = typeof process !== "undefined" && true ? "2.10.0" : "?";
|
|
1060
1060
|
|
|
1061
1061
|
//#endregion
|
|
1062
1062
|
//#region src/tracing/utils/instrumentationGuard.ts
|
|
@@ -1056,7 +1056,7 @@ var FetchFileReader = class {
|
|
|
1056
1056
|
|
|
1057
1057
|
//#endregion
|
|
1058
1058
|
//#region src/env/index.ts
|
|
1059
|
-
const CLIENT_VERSION = typeof process !== "undefined" && true ? "2.
|
|
1059
|
+
const CLIENT_VERSION = typeof process !== "undefined" && true ? "2.10.0" : "?";
|
|
1060
1060
|
|
|
1061
1061
|
//#endregion
|
|
1062
1062
|
//#region src/tracing/utils/instrumentationGuard.ts
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_catchWindowErrors = require('./catchWindowErrors-
|
|
2
|
+
const require_catchWindowErrors = require('./catchWindowErrors-zf246a2G.cjs');
|
|
3
3
|
const require_browser = require('./browser.cjs');
|
|
4
4
|
let _flareapp_core = require("@flareapp/core");
|
|
5
5
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as createFlareResolver, t as catchWindowErrors } from "./catchWindowErrors-
|
|
1
|
+
import { n as createFlareResolver, t as catchWindowErrors } from "./catchWindowErrors-CkFI5Vwv.mjs";
|
|
2
2
|
import { Flare } from "./browser.mjs";
|
|
3
3
|
import { DEFAULT_URL_DENYLIST, FrameworkName, GlobalScopeProvider, Logger, NullFileReader, Scope, convertToError, redactObjectValues, redactUrlQuery, redactUrlQuery as redactFullPath, resolveDenylist, toCustomContext } from "@flareapp/core";
|
|
4
4
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flareapp/js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "JavaScript client for flareapp.io",
|
|
5
5
|
"homepage": "https://flareapp.io",
|
|
6
6
|
"bugs": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"release": "release-it"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@flareapp/core": "2.
|
|
62
|
+
"@flareapp/core": "2.10.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@flareapp/test-helpers": "*",
|