sentry/sdk
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
sentry/sentry | 4.7.0 | - | MIT | prod |
The sentry/sdk is a Composer metapackage that ships with the sentry/sentry library and a recommended HTTP client. Sentry, a market leader in error tracking applications, provides this SDK to facilitate easy integration with PHP projects. By tracking errors and exceptions in real-time, it significantly improves the application debugging process and makes performance-monitoring smoother.
To utilize the sentry/sdk, you first need to install it using Composer. You can accomplish this by running the command:
composer require sentry/sdk:"<Package Version>"
Replace <Package Version> with the latest version compatible with your project.
Below is a rudimentary code example of how you might use the Sentry PHP SDK in your project. Remember that this is just basic usage and the SDK offers far more capabilities that can be tapped into.
\Sentry\init(['dsn' => 'https://<public_key>@sentry.io/<project_id>']);
try {
thisFunctionThrows(); // An example function that throws an exception
} catch (Exception $exception) {
\Sentry\captureException($exception); // The exception is caught and reported to Sentry
}
In the above script, replace <public_key>
and <project_id>
with your actual Sentry DSN values.
For detailed documentation and further learning resources on Sentry PHP SDK, you can refer to the official documentation. If you encounter any troubles with the SDK or need assistance in a specific area, you can raise an issue on their issues tracker on GitHub.