@useknest/widget-core 0.1.0-beta.15 → 0.1.0-beta.16

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2078,7 +2078,6 @@ const We = "https://005d25250a41bd0071570b0c0a2b2c4d@o4510467570073600.ingest.us
2078
2078
  "knest"
2079
2079
  ];
2080
2080
  function je(n) {
2081
- if (n.tags?.source === "knest-widget") return !0;
2082
2081
  const u = n.exception?.values?.[0]?.stacktrace?.frames;
2083
2082
  return !u || u.length === 0 ? !1 : u.some((e) => {
2084
2083
  const l = e.filename || "";
@@ -2100,15 +2099,13 @@ function Tt() {
2100
2099
  xhr: !1
2101
2100
  })
2102
2101
  ],
2103
- // Tag all events as coming from the widget.
2104
- initialScope: {
2105
- tags: {
2106
- source: "knest-widget"
2107
- }
2108
- },
2109
- // Filter out errors that don't originate from our widget code.
2102
+ // Filter out errors that don't originate from our widget code, then stamp the
2103
+ // source tag so all events reaching Sentry are identifiable as widget errors.
2104
+ // NOTE: we do NOT use initialScope to set this tag — that would apply it to every
2105
+ // event the SDK captures (including host-page errors via GlobalHandlers/onerror),
2106
+ // which would bypass the isWidgetError check and let customer errors through.
2110
2107
  beforeSend(n) {
2111
- return je(n) ? n : null;
2108
+ return je(n) ? (n.tags = { ...n.tags, source: "knest-widget" }, n) : null;
2112
2109
  }
2113
2110
  }), pe = !0);
2114
2111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useknest/widget-core",
3
- "version": "0.1.0-beta.15",
3
+ "version": "0.1.0-beta.16",
4
4
  "type": "module",
5
5
  "description": "Core business logic for Knest chat widget",
6
6
  "files": [