justbetter / magento2-sentry-logrocket
Magento 2 LogRocket integration for JustBetter Sentry
Package info
github.com/justbetter/magento2-sentry-logrocket
Type:magento2-module
pkg:composer/justbetter/magento2-sentry-logrocket
Requires
- php: >=8.2
- justbetter/magento2-core: ^1.0
- justbetter/magento2-sentry: ^5.0
- magento/framework: >=103.0.7
- magento/module-config: >=101.2
- magento/module-csp: *
- magento/module-customer: *
Requires (Dev)
- bitexpert/phpstan-magento: ^0.42.0
- justbetter/magento2-coding-standard: ^1.0,>=1.0.2
- magento/magento-coding-standard: >=40
- rector/rector: >=1.2.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-11-04 14:07:38 UTC
README
Magento 2 Sentry LogRocket
This module adds LogRocket session replay to justbetter/magento2-sentry.
It loads the LogRocket script tag next to the Sentry script tag, and attaches the LogRocket session URL to the
Sentry event context as sessionURL, so you can jump from a Sentry issue straight into the LogRocket session
that caused it.
LogRocket support used to be built into justbetter/magento2-sentry itself. Since magento2-sentry 5.0.0 it has
been extracted into this separate module, so that shops that don't use LogRocket no longer carry its config
fields, CSP rule and customer-data plugin.
Features
- Loads the LogRocket script tag whenever the Sentry script tag is enabled
- Attaches the LogRocket session URL to the Sentry event context (
sessionURL) - Optionally identifies the logged in customer to LogRocket (name + email)
- Adds the LogRocket CDN to the Content-Security-Policy
script-srcwhitelist
Requirements
justbetter/magento2-sentry^5.0(LogRocket must be configured through the Sentry module's script tag settings)
Installation
composer require justbetter/magento2-sentry-logrocketbin/magento module:enable JustBetter_SentryLogrocketbin/magento setup:upgradebin/magento setup:di:compilebin/magento setup:static-content:deploy
Upgrading from magento2-sentry 4.x
If you were already using LogRocket through justbetter/magento2-sentry 4.x, upgrade to magento2-sentry 5.0.0
and install this module. No configuration changes are needed — the config paths and env.php key are unchanged.
If you don't use LogRocket, you can safely upgrade magento2-sentry to 5.0.0 without installing this module.
Configuration
This module reuses the JustBetter Sentry configuration under Stores > Configuration > JustBetter > Sentry configuration.
The LogRocket script tag is only rendered when Sentry's own Enable Javascript Tracking is enabled.
Configuration values
| Name | Location | Description |
|---|---|---|
Use LogRocket |
General config | Enables the LogRocket script tag. |
LogRocket include user data |
General config | Identifies the logged in customer to LogRocket with their name and email. |
Logrocket Key |
Environment Configuration | Your LogRocket app ID, e.g. example/example. |
Alternatively, the LogRocket key can be set through the Magento Deployment Configuration
in app/etc/env.php, under the same sentry array used by justbetter/magento2-sentry:
'sentry' => [
'logrocket_key' => 'example/example',
]
Content-Security-Policy
When LogRocket is enabled, https://cdn.lr-ingest.io is automatically added to the script-src CSP policy.
Compatibility
The module is tested on Magento version 2.4.x with justbetter/magento2-sentry 5.x.
Ideas, bugs or suggestions?
Please create a issue or a pull request.
Contributing
Contributing? Awesome! Thank you for your help improving the module!
Please see CONTRIBUTING for details.
Most importantly:
- When making a PR please add a description what you've added, and if relevant why.
- To save time on codestyle feedback, please run
composer installcomposer run codestylecomposer run analyse
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
License
The MIT License (MIT). Please see License File for more information.