fof / sentry
Flarum integration for Sentry
                                    Fund package maintenance!
                                                                            
                                                                                                                                        Website
                                                                                    
                                                                
Installs: 14 228
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 5
Forks: 5
Open Issues: 2
Type:flarum-extension
pkg:composer/fof/sentry
Requires
- flarum/core: ^1.3.1
- sentry/sdk: ^3.1.0
Requires (Dev)
This package is auto-updated.
Last update: 2025-10-29 14:16:09 UTC
README
A Flarum extension. Flarum integration for Sentry.
Installation
Install with composer:
composer require fof/sentry:"*"
Updating
composer update fof/sentry:"*"
Configuration
Configure the extension in the admin panel. You'll need to provide your Sentry DSN to get started.
Customizing Sentry for Developers
This extension provides an extender that allows other extensions to customize Sentry configuration. You can use this to set custom release versions, add tags, and more. All settings are applied to both the PHP backend and JavaScript frontend.
Basic Usage
In your extension's extend.php file:
use FoF\Sentry\Extend\Sentry; return [ // Other extenders (new Sentry()) ->setRelease('my-app-v1.2.3') ->setEnvironment('production') ->addTag('app_name', 'My Awesome App'), ];
Available Methods
setRelease(string $release)
Set a custom release version for Sentry events (applied to both backend and frontend):
(new Sentry())->setRelease('v2.0.0-beta.1');
setEnvironment(string $environment)
Set a custom environment name (applied to both backend and frontend):
(new Sentry())->setEnvironment('staging');
addTag(string $key, string $value)
Add a custom tag to all Sentry events (applied to both backend and frontend):
(new Sentry()) ->addTag('server_type', 'dedicated') ->addTag('php_version', PHP_VERSION);
Example: Setting Environment Variables
You can use environment variables to configure Sentry:
(new Sentry()) ->setRelease(env('APP_VERSION', 'development')) ->setEnvironment(env('APP_ENV', 'production')) ->addTag('server_id', env('SERVER_ID', 'unknown'));
Links
An extension by FriendsOfFlarum, commissioned by webdeveloper.com.