How the official Strapi Sentry plugin reports errors
A team running Strapi in production needs errors to reach Sentry without anyone having to guess what failed or where. The official Strapi Sentry plugin does this: it sends errors to Sentry with debugging metadata, and it can be limited to production or switched off entirely. This section sets out what the plugin does, what it attaches to each report, and which decisions you should make before installing it. The step-by-step setup and the configuration keys are covered in the sections that follow, so this part is about the reporting model you are adopting.
The plugin is the vendor's own, documented in the Strapi docs for the Sentry plugin, so it is the natural first read before you write custom error hooks. Your team should decide three things up front: which environments send events, which Sentry project receives them, and whether a non-production environment needs any reporting at all. Strapi's documentation describes the plugin as disableable for non-production environments or entirely, which makes the environment split a configuration choice rather than a code change. Confirm the exact configuration keys, the supported Strapi version, and the Sentry SDK version in the plugin documentation for your release before you pin them in your project, because those details are outside the facts this page relies on.
The metadata the plugin attaches is the part your on-call engineers will rely on most, so review it with your security and data protection leads before go-live. Errors that reach Sentry can include request and runtime context, and that context may contain personal data or secrets if your code places them there. Ask the plugin's documentation which fields it captures, then check whether your controllers, policies and logs expose sensitive values. Agree on a retention period and access list for the Sentry project, and confirm where the Sentry instance is hosted, since that determines which data location and processor terms apply to your reports.
What you need before installing the Sentry plugin
The Sentry plugin is only as useful as the environment it runs in. Each item below is a dependency that must be settled before the plugin is installed, because a mismatch in any one of them shows up as missing errors, failed installs or events that never reach the client's Sentry project.
Matching Strapi and Node.js versions
Confirm the exact Strapi 5 version in use and install the Sentry plugin release documented for that version, not the latest package by default. Strapi 5 runs only on Active or Maintenance LTS Node.js versions, so check the installation requirements against the Node.js version on the build and runtime hosts. A plugin built for one Strapi release can fail at startup on another, and a mismatch between build and runtime Node.js versions is easy to miss until deployment.
Installation requirementsSupported database for the project
The Sentry plugin does not change the database, but the Strapi project it runs in does. Confirm the project uses PostgreSQL 14 or later, MySQL 8.0 or later, MariaDB 10.3 or later or SQLite 3, because Strapi 5 does not support MongoDB or other NoSQL databases. Error reporting during a failed database connection is only useful if the team already knows which database the service is expected to reach.
A Sentry project and DSN owned by the client
Create or confirm a Sentry project in the client's own organization and generate the DSN from it. The DSN identifies where events are sent, so it should be held by the client's platform team rather than a vendor account. Ask who administers the Sentry organization, who can rotate the DSN and how team members are granted access to issues before the first event is sent.
Outbound network access to Sentry
The Strapi host must reach the Sentry ingestion endpoint over HTTPS. Confirm with the network team whether egress is allowed directly, through a proxy or through an allow list, and whether the client uses self-hosted Sentry, which changes the destination. Test the route from the same host, container or pod that runs Strapi, because a firewall rule that works from a workstation may not apply to the service network.
Access to the secrets store
The DSN and environment-based switches should be stored in the platform's secrets store, not committed to the repository. Confirm who can create and read these variables in each environment, how they are injected into containers or process managers, and how a rotated DSN is deployed without downtime. Staging and production should use separate values so test errors do not appear in the production project.
Sign-off on what leaves the system
Error reports carry debugging metadata, so the security and compliance owners should review what the plugin attaches before it is enabled in production. Agree who approves the change, where event retention is configured in the client's Sentry plan and how personal data in request or user context is handled. Record the decision so auditors can trace why error reporting was enabled and in which environments.
Installing and configuring the plugin in order
This sequence takes a Strapi project from no error reporting to a verified Sentry event from a non-production environment. Each step builds on the one before it, so the production scope is set before any test error is sent. The result is a configuration that reports from production and stays quiet elsewhere by default.
Install the Sentry plugin package
A developer on the Strapi project adds the official Sentry plugin to the project's dependencies and installs it with the package manager the project already uses. Before installing, confirm the exact package name and the version that matches your Strapi 5 release in the plugin documentation. The step is done when the install completes without errors and the package appears in the dependency list and lock file, committed to the repository.
Register the plugin in configuration
The developer adds a Sentry entry to the project's plugin configuration so Strapi loads the plugin at startup. Only set the options the plugin documentation requires at this stage, and keep the configuration in code so every environment reads the same file. The step is done when the Strapi server starts cleanly with no plugin load errors in the startup logs.
Set the DSN and environment name
Store the Sentry DSN and an environment name, such as production or staging, in each environment's variables, and have the plugin configuration read them. Ask your security team to confirm how the DSN is stored and who can read it, since it identifies where events are sent. The step is done when each environment reads its own values and no DSN appears in the repository.
Scope the plugin to production
Configure the plugin so reporting is active for production and disabled for other environments, using the options the plugin documentation describes for this purpose. Confirm the exact option names in the official docs before editing, because a misspelled key may fail silently. The step is done when a non-production server starts with reporting off and a server configured as production starts with reporting on.
Trigger a test error outside production
Temporarily enable reporting on a non-production Strapi instance under its own environment name, then trigger a controlled test error, for example through a throwaway test route that is removed afterward. Note the time of the test so you can find the event in the next step. Turn reporting back off once the check passes so the non-production default holds. The step is done when the server raises the error and no unexpected failures occur elsewhere.
Confirm the event in Sentry
In Sentry, open the project you assigned to this environment and find the test event from the time you noted. Check that the environment field matches the name you configured and that the metadata the plugin attaches is present. The step is done when the event appears in the intended project and environment, and nothing from the test appears in the production project.
Configuring Sentry differently for each environment
Production is the environment where Sentry must receive unhandled errors, so the plugin stays enabled there and points at the production DSN. Set the DSN from a runtime environment variable on the production host or in your orchestrator, and confirm that the plugin is active only in the production configuration.
- Enabled for production: Keep the plugin on in the production configuration so application errors reach Sentry without an extra deployment step.
- Production DSN only: Point production at the DSN of the Sentry project created for production, so events land in the correct project.
- Alert routing: Decide who receives alerts from the production project before go-live, because routing is configured in Sentry.
- Controlled test event: Trigger one deliberate error after deployment to confirm that events arrive.
- Metadata review: Read the metadata section of the plugin docs and confirm that the attached debugging data is acceptable for production.
Check that the production instance delivers the test event to the production project and to no other project.
Staging is a policy decision rather than a technical default. Some teams report staging errors to reproduce production issues before release. Others disable reporting to keep noise, cost and data exposure low. Choose one option, document it, and apply it consistently in the configuration for that environment.
- Enabled with its own project: Use a staging DSN that points to a separate Sentry project, so staging errors never mix with production issues.
- Disabled by policy: Turn the plugin off for non-production environments using the disable options in the plugin docs if your policy keeps staging events inside your network.
- Data sensitivity: Staging often holds copies of production data. Confirm which request and user details the plugin sends before enabling it.
- No shared DSN: Never reuse the production DSN in staging, even temporarily.
- Named triage owner: If staging is enabled, name the team that reviews and closes staging events.
Check the chosen option against your data handling policy and record which setting applies to staging.
Local development should not send events to Sentry. Developers run builds constantly, produce frequent expected errors, and may hold test data that should not leave their machines. The plugin docs describe options to disable it for non-production environments or entirely, and that disable setting should be the default for local runs. Confirm the exact option names in the Strapi Sentry plugin docs for your installed version.
- Disabled by default: Use the non-production disable option so local runs never send events, even when a DSN is present.
- No production DSN on laptops: Do not copy production DSNs into developer
.envfiles or shared setup notes. - Sandbox project for integration tests: If developers must test the Sentry integration, give them a separate, low-volume project with its own DSN.
- Environment branch in config: Check the environment branch in the
config/plugins.jsfile of each developer setup so the local branch matches the policy. - Automated test runs: Confirm that CI test runs do not report to Sentry unless that is intended.
Trigger a deliberate error locally and confirm that no Sentry project receives it.
The DSN identifies the Sentry project that receives events, and it should be handled like other credential-like configuration. Keep it out of Git so that repository access does not expose it, and confirm for each environment which Sentry project actually receives events. Verification is the step most teams skip, and it is the only reliable way to know that the environment split works.
- Environment variables: Read the DSN from an environment variable set in your hosting platform, container orchestrator or secrets manager, not hardcoded in
config/plugins.js. - Git hygiene: Keep
.envfiles out of version control and run your secrets scanning tool before merging configuration changes. - Structure in Git, values outside it: Commit the environment split and disable logic, but never the DSN values.
- Per-environment verification: For each environment, trigger a test error and record which Sentry project receives it, and whether it does.
- Change control: Treat changes to the DSN or disable settings like other production configuration changes, with review and a record of who approved them.
Re-run the verification after every deployment that changes configuration, and confirm the disable options against the plugin docs for your installed Strapi version.
What metadata Sentry receives and what to review
Review the metadata before go-live, because the Strapi Sentry plugin attaches debugging context to every error it reports, and that context can contain request details, user identifiers and configuration values. The plugin docs describe the metadata in general terms, so the exact fields your Sentry project receives depend on your Strapi version, plugin version and error path. Treat the plugin as a data flow that needs the same review as any other system sending records to a third party. Confirm with the vendor documentation at Strapi's Sentry plugin docs which fields are attached before you rely on that list.
The check that matters most is a test event sent from a staging environment that holds realistic but non-sensitive data. Trigger a controlled error on an authenticated route, a public route and an admin route, then open the event in Sentry and inspect every context block, breadcrumb, tag and request field that arrived. Look for authorization headers, cookies, API tokens, query strings containing identifiers, request bodies with personal data, and any environment variables that were serialized into the event. Compare what you see against the dsn and environment settings in your configuration, since a DSN is itself a credential that should not appear in event payloads.
Once you know the fields, decide how they fit your data handling rules. Ask your privacy and security owners whether user identifiers such as email addresses or internal IDs may leave your environment, which region the Sentry project is hosted in, and what retention and access controls apply to events. If any sensitive field arrives, use Sentry's data scrubbing settings or change the code path before production, and record the decision. Repeat the test after each plugin or Strapi upgrade, since the attached metadata can change between releases.
Mapping Strapi environments and Sentry settings
This table maps each Strapi environment to its Sentry project, environment tag, DSN source and plugin state, with an owner and a check for each row. Read it before go-live to confirm that production errors reach the right Sentry project and that staging and local builds do not send noise. The main takeaway is that the plugin's on or off state should follow from the environment, not from a hand-edited setting.
| Mapping item | Target setting | Owner | Check that the mapping works |
|---|---|---|---|
| Production Strapi instance | Plugin enabled, reporting to the production Sentry project | Platform engineering | Trigger a controlled test error and confirm it appears in the production project |
| Staging Strapi instance | Plugin disabled or pointed at a separate non-production project | Platform engineering | Confirm no staging errors appear in the production project after a test error |
| Local development | Plugin disabled by environment configuration | Developers | Start the server locally and confirm no events are sent to Sentry |
| Sentry environment tag | Name matches the Strapi environment, such as production or staging | Application owner | Filter the Sentry issue stream by environment and confirm the tag matches the deployment |
| DSN source | Loaded from a secret store or environment variable, never committed to source control | Security engineering | Confirm the DSN is injected at runtime and absent from the repository and build artifacts |
| Plugin enabled flag | Set per environment in the Strapi configuration, documented in the change record | Application owner | Compare the running configuration with the documented value after each deployment |
| Sentry project access | Limited to the teams that triage Strapi errors | Security engineering | Review project membership against the team roster before go-live and on a regular schedule |
| Sensitive data in events | Reviewed against the metadata the plugin attaches before enabling in production | Compliance lead | Trigger a test error and inspect the event payload for personal data or secrets |
Protecting the DSN and limiting what leaves the server
The DSN identifies where Strapi sends its error events, and the event payloads decide what leaves your server. The cards below cover the controls that protect the DSN and the review steps for content that Sentry receives. Each step is a check to run in your own environment, not a guarantee that the plugin or Sentry removes data on its own.
Store the DSN as a secret
The Sentry DSN is a project-specific address that tells the plugin where to send events. Keep it out of source control and out of the admin panel by supplying it through an environment variable such as SENTRY_DSN in your deployment secret store. Confirm that build logs, container inspection output and CI variables do not print it. Treat the DSN as a credential for your project, because anyone holding it can send events that appear in your project.
Restrict who reads project settings
Anyone with access to the Sentry project can see the DSN, event details and stack traces, which may include request paths, user identifiers and configuration values. Review Sentry team and role assignments so that only engineers who triage errors have access. Check which members can change project keys, alert rules and data retention, and remove access for people who have left or changed roles. Ask Sentry for the current options for role-based access and audit history on your plan.
Review scrubbing before production
Before you enable reporting in production, send test errors from a staging instance and read the full event in Sentry. Look for request bodies, headers, query strings, tokens, email addresses and file names that should not be stored outside your infrastructure. Confirm whether Sentry's data scrubbing and sensitive field rules cover the fields your content types use. Record the result as a review step with a named owner, and repeat it when you add content types or change error handling.
Keep admin and API settings out of payloads
Error events can capture configuration and request context, so review what reaches the reporting path. Confirm that Strapi admin credentials, API tokens, JWT secrets, database connection strings and the Users & Permissions settings never appear in an event, log line or breadcrumb. Check that the Authorization header and API token values from REST or GraphQL calls are filtered before sending. Ask whether the plugin exposes any option that adds configuration to the event, and disable it if it does.
Disable reporting outside production
The plugin can be turned off for non-production environments or disabled entirely, so development and test errors do not reach the production Sentry project. Set the enable flag from an environment variable and confirm in each environment that no event is sent when the DSN is empty or the flag is off. Use a separate Sentry project or environment label for staging if your team needs to test the integration, and check that its events do not mix with production alerts.
Rotate the DSN if it leaks
If the DSN appears in a public repository, a log, a screenshot or a former team member's machine, plan to rotate it. In Sentry, create or regenerate a client key for the project, update the SENTRY_DSN value in each environment, and redeploy Strapi so the new value is loaded. Then review events received since the exposure for spam or unfamiliar sources, and decide whether to rate-limit or revoke the old key. Write this procedure into your incident runbook and test it in staging before you need it.
Why Strapi errors do not appear in Sentry
This table lists the most common reasons Strapi errors fail to reach Sentry, with the likely cause, the check to run and the fix for each. Work through the rows in order, since the DSN and environment checks rule out the most cases quickly. Confirm exact plugin option names and version compatibility against the Strapi Sentry plugin documentation for your release.
| Failure | Likely cause | Check and fix |
|---|---|---|
| Missing or wrong DSN | The DSN is absent from the environment, copied from the wrong Sentry project, or truncated during deployment | Confirm the DSN in the running container or process, not only in the local file. Compare it with the project's client keys in Sentry and redeploy after correcting it. |
| Plugin enabled in the wrong environment | Configuration sets the plugin to report only in production, but the test server runs with a different NODE_ENV value | Print the effective environment value at startup and check the plugin's environment settings. Align the variable across hosts so the intended environment reports. |
| Plugin disabled or not loaded | The plugin is missing from the project's plugin configuration, or the build was not rebuilt after installation | Check that the plugin entry exists in the config and that the admin and server were rebuilt and restarted. Trigger a deliberate test error to confirm the plugin is active. |
| Outbound traffic blocked | A firewall, egress policy or corporate proxy stops the server from reaching the Sentry ingest endpoint | From the Strapi host, test HTTPS connectivity to the DSN host. If blocked, allow the ingest host through the egress rule or configure the proxy settings your platform team approves. |
| Version mismatch with Strapi | The plugin release does not match the installed Strapi 5 version, so hooks fail silently after an upgrade | Compare the plugin version with the Strapi version in package.json and the plugin's compatibility notes. Pin a compatible plugin version and retest after each Strapi upgrade. |
| Events filtered or dropped in Sentry | Inbound filters, sampling rates, ignored error types or issue grouping rules hide the events | Review the project's inbound filters, sampling and ignored-error settings, then check the Issues and Discover views with a wide time range. Adjust filters only after confirming the events arrived. |
| Errors handled before reaching the plugin | Application code catches and logs errors without rethrowing, so the failure never reaches the error path Sentry observes | Search custom controllers and services for catch blocks that swallow errors. Rethrow or report them explicitly so they reach the plugin path. |
Questions teams ask before adding Sentry to Strapi
What does it cost to add Sentry error tracking to Strapi?
No fixed price applies here, because the cost is the labor for a fixed-scope engagement plus any Sentry subscription you already hold or buy. The plugin itself is an open-source add-on, and the cost components are the configuration work, the review of what metadata leaves your environment, and the testing across each environment. Costs rise with the number of Strapi instances, the number of non-production environments you want to control separately, and how much review your security team requires. Ask any quote to list each of these as a line item and to state which Sentry plan and event volume you are assuming.
What drives the effort for a Sentry setup on Strapi?
Effort follows the shape of your deployment more than the plugin itself. The main drivers are how many Strapi instances report errors, how many environments need different settings, whether secrets are managed through your existing vault or CI variables, and how many people must approve the metadata the plugin attaches to each event. A single production instance with one reviewer is a small job. Several instances across staging, QA and production, each with its own Sentry project, takes longer because each configuration must be checked separately.
How long does a basic Sentry setup for Strapi take?
A basic setup on one instance is short when access and approvals are ready, and it grows when either is missing. The timing depends on how quickly you can grant Sentry access, issue a DSN for the right project, and get sign-off on the metadata review. Your own environment sets these waits, so confirm them before agreeing a timeline. A written scope should state the number of instances, the environments covered and the review steps, because those three items determine the schedule.
What do we need to provide before a Sentry integration starts?
Provide four things: access to the Sentry organization with permission to create or select projects, the DSN for each Strapi project, a list of the environments that should report and those that should stay silent, and a named approver for the metadata that will be sent. Also provide access to the Strapi repository, the hosting environment where secrets are stored, and a test instance where errors can be triggered safely. Missing items usually show up as delays, so check the list against your own access model before kickoff.
Can our in-house team add Sentry to Strapi without a partner?
Yes, a team that already runs Strapi and Sentry can usually do the core work. The plugin is installed in the Strapi project, configured through environment-based settings, and tested by triggering an error in a non-production environment. The parts that often need extra attention are keeping the DSN out of source control, confirming that non-production environments stay disabled, and reviewing the metadata with security and privacy owners. Decide whether your team has time for that review and for keeping configurations consistent across instances.
Does our Strapi plan affect how we set up Sentry?
The plugin does not depend on a Strapi plan, since it runs in the project you host. The plan choice matters for the surrounding controls. Strapi's self-hosted pricing page lists SSO as an add-on for Growth and as included in Enterprise, and places audit logs and review workflows in Enterprise. If your error tracking review depends on who can see admin activity, confirm which of those controls your chosen plan provides before you rely on them.
What metadata does the Sentry plugin send, and who should approve it?
The plugin reports errors with debugging metadata, so the approver should be the person who owns privacy or data handling for the Strapi project. Review the fields attached to each event against your data classification before enabling production reporting. Confirm the exact metadata set in the plugin documentation for your installed version, because the list can change between releases. Record the approval so that a future change to the plugin triggers a new review.
How DeployOpen works on this
DeployOpen plans and implements self-hosted open-source platforms inside your own cloud accounts, data centers or air-gapped networks. For Error tracking for Strapi with Sentry, the work is scoped in writing first, built against your environments, and handed over with documentation your team can run.
How we scope
- Confirm which Strapi environments exist and which of them should report errors to Sentry.
- Agree whether Sentry is self-hosted or hosted, and who owns the project, DSN and alert routing.
- Agree the written scope, deliverables and timeline before any configuration work starts.
How we build
- Install the official Sentry plugin in your Strapi project and pin the version to your release.
- Configure the DSN and environment values from your secrets store, not from source control.
- Turn reporting off outside production and test that events from staging never reach production projects.
How we hand over
- Deliver a runbook covering configuration keys, environment switches and how to rotate the DSN.
- Document which metadata Sentry receives so your privacy and security reviewers can check it.
- Walk your engineers through a test error, the Sentry dashboard and the alert rules agreed in scope.
How we support
- Review the plugin again when you upgrade Strapi, since plugin compatibility must be rechecked.
- Offer ongoing support and upgrades as a retainer if your team wants continued coverage.
- Confirm with your Sentry administrator how long error events are retained in your plan.

