@picked/sentry 0.0.1-dev.1765490623116 → 0.0.1-dev.1765841386439

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,10 +5,22 @@ 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
 
12
+ ## ⚠️ Version Compatibility
13
+
14
+ This plugin depends on Sentry's internal carrier implementation. **Version mismatches between your application's Sentry SDK and the version used by `@picked/sentry` plugin will cause the plugin to stop working.**
15
+
16
+ **Requirements:**
17
+
18
+ - **Sentry SDK Version**: This plugin requires Sentry SDK version `^10.0.0`
19
+ - **Peer Dependencies**: This plugin requires `@sentry/browser` to be installed in the client, as it is a peerdepency in this package. This ensures version compatibility between the client and the plugin
20
+ - **Package Compatibility**: All Sentry packages (`@sentry/browser`, `@sentry/svelte`, `@sentry/node`, etc.) must use the same major version to ensure proper functionality
21
+
22
+ **Note**: Install the appropriate Sentry package for your framework alongside this plugin. The plugin will use the same Sentry instance from the client, preventing version conflicts.
23
+
12
24
  ## 🚀 Quick Start
13
25
 
14
26
  Here's a basic example of how to use the `Sentry` Plugin:
@@ -20,6 +32,6 @@ import { sentryPlugin } from '@picked/sentry'
20
32
 
21
33
  const client = createClient({
22
34
  // ... values
23
- 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
24
36
  })
25
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.1765490623116",
4
+ "version": "0.0.1-dev.1765841386439",
5
5
  "dependencies": {},
6
6
  "devDependencies": {
7
7
  "@picked/client": "workspace:*",
@@ -9,7 +9,6 @@
9
9
  "@repo/eslint-config": "workspace:*",
10
10
  "@repo/typescript-config": "workspace:*",
11
11
  "@rollup/plugin-replace": "^6.0.2",
12
- "@sentry/browser": "10.30.0",
13
12
  "@types/jsdom": "^21.1.7",
14
13
  "@types/node": "^22",
15
14
  "@vitest/coverage-v8": "^3.2.4",
@@ -33,8 +32,8 @@
33
32
  "main": "./dist/cjs/index.js",
34
33
  "module": "./dist/esm/index.js",
35
34
  "peerDependencies": {
36
- "@picked/client": "0.0.1-dev.1765490623116",
37
- "@sentry/browser": "10.30.0"
35
+ "@picked/client": "0.0.1-dev.1765841386439",
36
+ "@sentry/browser": "^10"
38
37
  },
39
38
  "private": false,
40
39
  "scripts": {