@picked/sentry 0.0.101-next.2 → 0.0.101

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/README.md +31 -26
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,37 +1,42 @@
1
- # Sentry Plugin
1
+ # @picked/sentry
2
2
 
3
- This plugin is responsible for listening for the Picked Client `eventBus` and interacting with a Sentry instance by adding tags and triggering `captureMessage` and `captureException`.
3
+ Reports the errors of the Picked client to Sentry, and tags Sentry events with the Picked
4
+ session, feature flags and user decision.
4
5
 
5
- This are the events listened by the Plugin:
6
+ ## Install
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 `picked.id` to the Sentry global scope with the session id as value. Example: `picked.id: 000000000`
9
- - `feature_decide`: When the `feature_decide` event happens, the Plugin will add the tag `picked.feature.[FEATURE_ID]` to the Sentry global scope with the bucket as value. Example: `picked.feature.my_feature: true`
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
-
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.
8
+ ```bash
9
+ npm install picked @picked/sentry @sentry/browser
10
+ ```
23
11
 
24
- ## 🚀 Quick Start
12
+ Requires Sentry SDK 10. Every Sentry package in your application must be on the same major
13
+ version, or the plugin and your application see different Sentry scopes.
25
14
 
26
- Here's a basic example of how to use the `Sentry` Plugin:
15
+ ## Usage
27
16
 
28
17
  ```typescript
29
- // app.ts file
30
- import { getClient } from '@sentry/svelte'
18
+ import * as Sentry from '@sentry/browser'
19
+ import { createClient } from 'picked'
31
20
  import { sentryPlugin } from '@picked/sentry'
32
21
 
33
- const client = createClient({
34
- // ... values
35
- plugin: [sentryPlugin(getClient())], // Usually the array of plugins are defined earlier, so you can add the sentry plugin there
22
+ Sentry.init({ dsn: 'your-sentry-dsn' })
23
+
24
+ export const picked = createClient({
25
+ projectId: 'your-project-id',
26
+ plugins: [sentryPlugin()],
36
27
  })
37
28
  ```
29
+
30
+ | Client event | In Sentry |
31
+ | ---------------- | ------------------------------------------------------------------------------------- |
32
+ | `exception` | `captureMessage` at `info` level, otherwise `captureException`; tagged `picked: true` |
33
+ | `session` | Tag `picked.id`: the session ID |
34
+ | `feature_decide` | Tag `picked.feature.<feature ID>`: the bucket |
35
+ | `user_decide` | Tag `picked.is_user` |
36
+
37
+ ## Docs
38
+
39
+ - **Web:** [Sentry](https://docs.picked.app/reference/sdk/plugins/sentry)
40
+ - **Local:** `node_modules/picked/docs/reference/sdk/plugins/sentry.md`. The `picked` package carries every page under `node_modules/picked/docs/`.
41
+ - **CLI:** `npx picked docs read /reference/sdk/plugins/sentry`. `npx picked docs list [words]` lists the pages.
42
+ - **MCP:** call `read_picked_doc` with `{ "path": "/reference/sdk/plugins/sentry" }`; `list_picked_docs` lists the pages. Add the server with `claude mcp add --transport http picked https://api.picked.app/mcp`, or see [How to connect the MCP server](https://docs.picked.app/how-to/connect-the-mcp-server) for other tools.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@picked/sentry",
3
3
  "description": "Sentry plugin",
4
- "version": "0.0.101-next.2",
4
+ "version": "0.0.101",
5
5
  "devDependencies": {
6
6
  "@picked/client": "workspace:*",
7
7
  "@picked/svelte": "workspace:*",
@@ -47,7 +47,7 @@
47
47
  "main": "./dist/cjs/index.js",
48
48
  "module": "./dist/esm/index.js",
49
49
  "peerDependencies": {
50
- "@picked/client": "0.0.101-next.2",
50
+ "@picked/client": "0.0.101",
51
51
  "@sentry/browser": "^10"
52
52
  },
53
53
  "private": false,