@picked/sentry 0.0.1-dev.1765824208742 → 0.0.1-dev.1765928585401

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 CHANGED
@@ -5,7 +5,7 @@ This plugin is responsible for listening for the Picked Client `eventBus` and in
5
5
  This are the events listened by the Plugin:
6
6
 
7
7
  - `exception`: When an `exception` event is added to the `eventBus` the plugin will automatically check the `level` and based on that call `captureException` when the `level` is `error` and `captureMessage` when the `level` is `info`.
8
- - `session`: When the `session` event happens, the Plugin will add the tag `pickedId` to the Sentry global scope with the session id as value. Example: `pickedId: 000000000`
8
+ - `session`: When the `session` event happens, the Plugin will add the tag `picked.id` to the Sentry global scope with the session id as value. Example: `picked.id: 000000000`
9
9
  - `feature_decide`: When the `feature_decide` event happens, the Plugin will add the tag `picked.feature.[EVENT_NAME]` to the Sentry global scope with the bucket as value. Example: `picked.feature.my_feature: true`
10
10
  - `user_decide`: When the `user_decide` event happens, the Plugin will add the tag `picked.is_user` with the `user_decide` value. Example: `picked.is_user: true`
11
11
 
@@ -32,6 +32,6 @@ import { sentryPlugin } from '@picked/sentry'
32
32
 
33
33
  const client = createClient({
34
34
  // ... values
35
- plugin: [sentryPlugin(getClient())], // Usually the array of plugins are defined earlier, so you can add the sentry plugin there, the only requirement is to pass the getClient()
35
+ plugin: [sentryPlugin(getClient())], // Usually the array of plugins are defined earlier, so you can add the sentry plugin there
36
36
  })
37
37
  ```
package/dist/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@sentry/browser"),a=require("@picked/client"),s=()=>({name:"sentry-plugin",setup:i=>{if(a.supportsWindow())try{i.eventBus.watch(e=>{if(e.type==="exception"&&(e.level==="info"&&t.captureMessage(typeof e.data=="string"?e.data:JSON.stringify(e.data),{tags:{picked:!0}}),t.captureException(e.data,{captureContext:{tags:{picked:!0}}})),e.type==="session"&&t.setTag("picked.id",e.id),e.type==="feature_decide"){const r=`picked.feature.${e.feature.id}`;t.setTag(r,e.feature.bucket)}e.type==="user_decide"&&t.setTag("picked.is_user",e.value)})}catch{}}});exports.sentryPlugin=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@sentry/browser"),a=require("@picked/client"),s=()=>({name:"sentry-plugin",setup:i=>{if(a.supportsWindow())try{i.eventBus.watch(e=>{if(e.type==="exception"){if(e.level==="info"){t.captureMessage(typeof e.data=="string"?e.data:JSON.stringify(e.data),{tags:{picked:!0}});return}t.captureException(e.data,{captureContext:{tags:{picked:!0}}})}if(e.type==="session"&&t.setTag("picked.id",e.id),e.type==="feature_decide"){const r=`picked.feature.${e.feature.id}`;t.setTag(r,e.feature.bucket)}e.type==="user_decide"&&t.setTag("picked.is_user",e.value)})}catch{}}});exports.sentryPlugin=s;
package/dist/esm/index.js CHANGED
@@ -6,20 +6,27 @@ const d = () => ({
6
6
  if (s())
7
7
  try {
8
8
  e.eventBus.watch((t) => {
9
- if (t.type === "exception" && (t.level === "info" && a(
10
- typeof t.data == "string" ? t.data : JSON.stringify(t.data),
11
- {
12
- tags: {
13
- picked: !0
14
- }
9
+ if (t.type === "exception") {
10
+ if (t.level === "info") {
11
+ a(
12
+ typeof t.data == "string" ? t.data : JSON.stringify(t.data),
13
+ {
14
+ tags: {
15
+ picked: !0
16
+ }
17
+ }
18
+ );
19
+ return;
15
20
  }
16
- ), p(t.data, {
17
- captureContext: {
18
- tags: {
19
- picked: !0
21
+ p(t.data, {
22
+ captureContext: {
23
+ tags: {
24
+ picked: !0
25
+ }
20
26
  }
21
- }
22
- })), t.type === "session" && i("picked.id", t.id), t.type === "feature_decide") {
27
+ });
28
+ }
29
+ if (t.type === "session" && i("picked.id", t.id), t.type === "feature_decide") {
23
30
  const r = `picked.feature.${t.feature.id}`;
24
31
  i(r, t.feature.bucket);
25
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAE5D,eAAO,MAAM,YAAY,QAAO,MAoE/B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAE5D,eAAO,MAAM,YAAY,QAAO,MAsE/B,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@picked/sentry",
3
3
  "description": "Sentry plugin",
4
- "version": "0.0.1-dev.1765824208742",
4
+ "version": "0.0.1-dev.1765928585401",
5
5
  "dependencies": {},
6
6
  "devDependencies": {
7
7
  "@picked/client": "workspace:*",
@@ -32,7 +32,7 @@
32
32
  "main": "./dist/cjs/index.js",
33
33
  "module": "./dist/esm/index.js",
34
34
  "peerDependencies": {
35
- "@picked/client": "0.0.1-dev.1765824208742",
35
+ "@picked/client": "0.0.1-dev.1765928585401",
36
36
  "@sentry/browser": "^10"
37
37
  },
38
38
  "private": false,