{"_id":"@akbarsafari00/plugin-sentry","name":"@akbarsafari00/plugin-sentry","dist-tags":{"fa":"5.52.1-fa.1","latest":"5.52.1-fa.1"},"versions":{"5.52.1-fa.1":{"name":"@akbarsafari00/plugin-sentry","version":"5.52.1-fa.1","description":"Send Strapi error events to Sentry","homepage":"https://strapi.io","bugs":{"url":"https://github.com/strapi/strapi/issues"},"repository":{"type":"git","url":"git+https://github.com/strapi/strapi.git","directory":"packages/plugins/sentry"},"license":"SEE LICENSE IN LICENSE","author":{"name":"Strapi Solutions SAS","email":"hi@strapi.io","url":"https://strapi.io"},"maintainers":[{"name":"akbarsafari00","email":"akbarsafari00@gmail.com"}],"exports":{"./strapi-admin":{"types":"./dist/admin/src/index.d.ts","source":"./admin/src/index.ts","import":"./dist/admin/index.mjs","require":"./dist/admin/index.js","default":"./dist/admin/index.js"},"./strapi-server":{"types":"./dist/server/src/index.d.ts","source":"./server/src/index.ts","import":"./dist/server/index.mjs","require":"./dist/server/index.js","default":"./dist/server/index.js"},"./package.json":"./package.json"},"scripts":{"build":"run -T npm-run-all clean --parallel build:code build:types","build:code":"run -T rollup -c","build:types":"run -T run-p build:types:server build:types:admin","build:types:server":"run -T tsc -p server/tsconfig.build.json --emitDeclarationOnly","build:types:admin":"run -T tsc -p admin/tsconfig.build.json --emitDeclarationOnly","clean":"run -T rimraf dist","lint":"run -T eslint . --max-warnings=0","test:ts:back":"run -T tsc -p server/tsconfig.json","test:ts:front":"run -T tsc -p admin/tsconfig.json","watch":"run -T rollup -c -w","test:unit:vitest":"vitest run","test:unit:vitest:watch":"vitest --watch"},"dependencies":{"@sentry/node":"7.112.2","@strapi/design-system":"2.2.4","@strapi/icons":"2.2.4"},"peerDependencies":{"@strapi/admin":"^5.0.0","@strapi/strapi":"^5.0.0","react":"^17.0.0 || ^18.0.0","react-dom":"^17.0.0 || ^18.0.0","react-router-dom":"^6.30.3","styled-components":"^6.0.0"},"engines":{"node":">=20.0.0 <=26.x.x","npm":">=6.0.0"},"strapi":{"name":"sentry","displayName":"Sentry","description":"Send Strapi error events to Sentry.","kind":"plugin"},"private":false,"optionalDependencies":{},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_id":"@akbarsafari00/plugin-sentry@5.52.1-fa.1","_nodeVersion":"24.17.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-fX3MxoaSuzEe5ay7A2jIsIrKJotHhlieF952ZAwL1cuEa6wOPgpsR2LuGv045yKaoFI1NrLby6WmxXe0jdgKkg==","shasum":"4240119d83b06af2c0d79c82e7b671b38b60f38c","tarball":"https://registry.npmjs.org/@akbarsafari00/plugin-sentry/-/plugin-sentry-5.52.1-fa.1.tgz","fileCount":118,"unpackedSize":68612,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCI0PosGfIow3UiVadsgdDAbo6nnu34lpBAPoGyfCEIvwIhAKbhG1PIHeoQ4g15F8H9iRQqO0hGEEAxf5OXyP9pWYox"}]},"_npmUser":{"name":"akbarsafari00","email":"akbarsafari00@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-sentry_5.52.1-fa.1_1787468273447_0.8388299607145073"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-23T06:57:53.242Z","5.52.1-fa.1":"2026-08-23T06:57:53.592Z","modified":"2026-08-23T06:57:53.759Z"},"maintainers":[{"name":"akbarsafari00","email":"akbarsafari00@gmail.com"}],"description":"Send Strapi error events to Sentry","homepage":"https://strapi.io","repository":{"type":"git","url":"git+https://github.com/strapi/strapi.git","directory":"packages/plugins/sentry"},"author":{"name":"Strapi Solutions SAS","email":"hi@strapi.io","url":"https://strapi.io"},"bugs":{"url":"https://github.com/strapi/strapi/issues"},"license":"SEE LICENSE IN LICENSE","readme":"# Strapi plugin Sentry\r\n\r\nThe official plugin to track Strapi errors with Sentry.\r\n\r\n## Features\r\n\r\n- Initialize a Sentry instance when your Strapi app starts\r\n- Send errors encountered in your application's end API to Sentry\r\n- Attach useful metadata to Sentry events, to help you with debugging\r\n- Expose a global Sentry service\r\n\r\n## Installation\r\n\r\nTo install this plugin, you need to add an NPM dependency to your Strapi application.\r\n\r\n```sh\r\n# Using Yarn\r\nyarn add @strapi/plugin-sentry\r\n\r\n# Or using NPM\r\nnpm install @strapi/plugin-sentry\r\n```\r\n\r\n## Configuration\r\n\r\n| property       | type (default)   | description                                                                                                                                                                              |\r\n| -------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\r\n| `dsn`          | string (`null`)  | Your Sentry data source name ([see Sentry docs](https://docs.sentry.io/product/sentry-basics/dsn-explainer/)).                                                                           |\r\n| `sendMetadata` | boolean (`true`) | Whether the plugin should attach additional information (like OS, browser, etc.) to the events sent to Sentry.                                                                           |\r\n| `init`         | object (`{}`)    | A config object that is passed directly to Sentry during the `Sentry.init()`. See all available options [on Sentry's docs](https://docs.sentry.io/platforms/node/configuration/options/) |\r\n\r\n**Example**\r\n\r\n`./config/plugins.js`\r\n\r\n```js\r\nmodule.exports = ({ env }) => ({\r\n  // ...\r\n  sentry: {\r\n    enabled: true,\r\n    config: {\r\n      dsn: env('SENTRY_DSN'),\r\n      sendMetadata: true,\r\n    },\r\n  },\r\n  // ...\r\n});\r\n```\r\n\r\n## Global Sentry service\r\n\r\nYou can access a Sentry service throughout your app.\r\n\r\n```js\r\nconst sentryService = strapi.plugin('sentry').service('sentry');\r\n```\r\n\r\nThis service exposes the following methods:\r\n\r\n### `sendError(error, configureScope)`\r\n\r\nUse it to manually send errors to Sentry. The `configureScope` is optional, it allows you to customize the error event. Read more about Sentry's scope system [on their docs](https://docs.sentry.io/platforms/node/enriching-events/scopes/#configuring-the-scope).\r\n\r\n**Example**\r\n\r\n```js\r\ntry {\r\n  // Your code here\r\n} catch (error) {\r\n  // Either send a simple error\r\n  strapi.plugin('sentry').service('sentry').sendError(error);\r\n\r\n  // Or send an error with a customized Sentry scope\r\n  strapi\r\n    .plugin('sentry')\r\n    .service('sentry')\r\n    .sendError(error, (scope, sentryInstance) => {\r\n      // Customize the scope here\r\n      scope.setTag('my_custom_tag', 'Tag value');\r\n    });\r\n  throw error;\r\n}\r\n```\r\n\r\n### `getInstance()`\r\n\r\nUse it if you need direct access to the Sentry instance, which should already be initialized. It's useful if `sendError` doesn't suit your needs.\r\n\r\n**Example**\r\n\r\n```js\r\nconst sentryInstance = strapi.plugin('sentry').service('sentry').getInstance();\r\n```\r\n\r\n## Disabling for non-production environments\r\n\r\nIf the `dsn` property is set to a nil value (`null` or `undefined`) while `enabled` is true, the Sentry plugin will be available to use in the running Strapi instance, but the service will not actually send errors to Sentry. That allows you to write code that runs on every environment without additional checks, but only send errors to Sentry in production.\r\n\r\nWhen you start Strapi with a nil `dsn` config property, the plugin will print a warning:  \r\n`info: @strapi/plugin-sentry is disabled because no Sentry DSN was provided`\r\n\r\nYou can make use of that by using the `env` utility to set the `dsn` config property depending on the environment.\r\n\r\n**Example**\r\n\r\n`./config/plugins.js`\r\n\r\n```js\r\nmodule.exports = ({ env }) => ({\r\n  // ...\r\n  sentry: {\r\n    enabled: true,\r\n    config: {\r\n      // Only set `dsn` property in production\r\n      dsn: env('NODE_ENV') === 'production' ? env('SENTRY_DSN') : null,\r\n    },\r\n  },\r\n  // ...\r\n});\r\n```\r\n\r\n## Disabling altogether\r\n\r\nLike every other plugin, you can also disable this plugin in the plugins configuration file. This will cause `strapi.plugins('sentry')` to return undefined.\r\n\r\n**Example**\r\n\r\n`./config/plugins.js`\r\n\r\n```js\r\nmodule.exports = ({ env }) => ({\r\n  // ...\r\n  sentry: {\r\n    enabled: false,\r\n  },\r\n  // ...\r\n});\r\n```\r\n","readmeFilename":"README.md","_rev":"1-285fae9951eaa04b7a4a3944a1123480"}