@launchdarkly/o11y 1.5.0 → 1.6.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/dist/observe.d.ts CHANGED
@@ -713,6 +713,55 @@ declare type ObserveOptions = CommonOptions & {
713
713
  * @default 2000
714
714
  */
715
715
  flagExposureDedupeMaxSize?: number;
716
+ /**
717
+ * Query parameters to read from the page URL and add as attributes to all
718
+ * telemetry, as if passed to `LDObserve.setAttributes`.
719
+ *
720
+ * When the SDK initializes, each listed parameter present in
721
+ * `location.search` becomes an attribute named after the parameter (e.g.
722
+ * `utm_campaign`) on every span (including document load, page view and
723
+ * fetch/XHR spans), log, error and metric for the rest of the page load,
724
+ * including after SPA navigation drops it from the URL.
725
+ *
726
+ * Last touch: when an SPA navigation lands on a URL with any listed
727
+ * parameter, the captured values are replaced by that URL's values, and
728
+ * previously captured keys missing from it are removed, so the set always
729
+ * reflects one landing. A navigation without listed parameters keeps the
730
+ * current values. Spans already started keep the values they had.
731
+ *
732
+ * Values are kept in memory only; nothing is written to storage or
733
+ * cookies, so a later full page load captures again from its own URL.
734
+ *
735
+ * Only the listed keys are captured, so other query parameters (which may
736
+ * hold personal data such as emails or tokens) are never recorded this
737
+ * way. The default list contains UTM parameters only. A name ending in `*`
738
+ * matches every parameter with that prefix (e.g. `'utm_*'`).
739
+ *
740
+ * Keys set with `setAttributes` win: capture never replaces or removes a
741
+ * key the app set itself. `removeAttributes` removes a captured value
742
+ * (a later landing with that parameter captures it again). Keys in the
743
+ * namespaces the SDK sets itself (`highlight.*`, `launchdarkly.*`,
744
+ * `session.*`, `context.contextKeys.*`) are ignored.
745
+ *
746
+ * A custom list replaces the default. Set to `false` or `[]` to turn
747
+ * capture off.
748
+ * @default ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content']
749
+ * @example captureQueryParams: ['utm_source', 'utm_campaign', 'gclid']
750
+ */
751
+ captureQueryParams?: string[] | false;
752
+ /**
753
+ * Specifies whether to record the page that linked to this one. When the
754
+ * SDK initializes and `document.referrer` is a different origin, it is
755
+ * added as the `landing.referrer` attribute to all telemetry for the rest
756
+ * of the page load, as if passed to `LDObserve.setAttributes`.
757
+ *
758
+ * Only the origin and path are kept: the query string, fragment and any
759
+ * credentials are stripped so tokens or personal data in the referrer URL
760
+ * are not recorded. An empty or same-origin referrer sets nothing, and
761
+ * the value is not updated on SPA navigation.
762
+ * @default true
763
+ */
764
+ captureReferrer?: boolean;
716
765
  };
717
766
 
718
767
  declare type OtelInstrumentatonOptions = {
package/dist/observe.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./common-1QcQF8EE.js";
2
- import { O as e } from "./observe-TWCqC5wb.js";
1
+ import "./common-C6gSg2Rq.js";
2
+ import { O as e } from "./observe-CL-A2YiL.js";
3
3
  import "./LDObserve-o8Ro1UV8.js";
4
4
  import "./buffer-CwCRPuMA.js";
5
5
  export {
@@ -40,7 +40,7 @@ var fe = (e, t, s) => new Promise((l, c) => {
40
40
  }, b = (m) => m.done ? l(m.value) : Promise.resolve(m.value).then(u, f);
41
41
  b((s = s.apply(e, t)).next());
42
42
  });
43
- import { z as Bn, A as to, a as Le, S as Ye, d as Be, g as ri, r as _s, G as ni, b as io, c as so, o as ro, q as no, m as $s, e as li, f as rt, F as qs, V as lo, P as oo, h as ao, t as co, H as er, M as uo, i as ho, s as po, L as mo, B as fo, C as tr, D as bo, E as yo, p as Zo, l as ir, v as go, I as So, y as Xo, J as sr, K as Ro, N as Go, O as Vo, Q as Wo, R as Io, T as wo, U as Co } from "./common-1QcQF8EE.js";
43
+ import { z as Bn, A as to, a as Le, S as Ye, d as Be, g as ri, r as _s, G as ni, b as io, c as so, o as ro, q as no, m as $s, e as li, f as rt, F as qs, V as lo, P as oo, h as ao, t as co, H as er, M as uo, i as ho, s as po, L as mo, B as fo, C as tr, D as bo, E as yo, p as Zo, l as ir, v as go, I as So, y as Xo, J as sr, K as Ro, N as Go, O as Vo, Q as Wo, R as Io, T as wo, U as Co } from "./common-C6gSg2Rq.js";
44
44
  import { L as xo, s as vo, i as Me, a as Jt } from "./buffer-CwCRPuMA.js";
45
45
  import { LDRecord as Lo } from "./LDRecord.js";
46
46
  const ko = {
@@ -11283,4 +11283,4 @@ export {
11283
11283
  Ne as r,
11284
11284
  zu as s
11285
11285
  };
11286
- //# sourceMappingURL=record-Bgkzgi9x.js.map
11286
+ //# sourceMappingURL=record-BpTfYU5r.js.map