Sentry Plugin
The Sentry plugin integrates Sentry error tracking and monitoring into your Scully-generated static site. This allows you to track JavaScript errors and performance issues in your production static site.Overview
- Type: Post-Render Plugin
- Function: Injects Sentry SDK script into HTML
- Service: Sentry.io error tracking
Installation
Install the plugin as a dev dependency:Configuration
Configure the plugin in your Scully configuration file:Configuration Options
The plugin accepts configuration in two formats:Option 1: Individual Parameters
Providekey, org, and project separately:
https://{key}@{org}.ingest.sentry.io/{project}
Option 2: DSN String
Provide the complete DSN directly:Additional Options
src (optional)
Custom Sentry SDK source URL:https://browser.sentry-cdn.com/5.20.1/bundle.min.js
integrity (optional)
Subresource integrity hash for the Sentry SDK:sha384-O8HdAJg1h8RARFowXd2J/r5fIWuinSBtjhwQoPesfVILeXzGpJxvyY/77OaPPXUo
crossorigin (optional)
Control the crossorigin attribute:true (adds crossorigin="anonymous")
Getting Your Sentry Configuration
- Sign up for Sentry.io
- Create a new project or select an existing one
- Go to Settings > Projects > [Your Project] > Client Keys (DSN)
-
Copy the DSN, which looks like:
-
Extract the values:
- key:
abc123def456(betweenhttps://and@) - org:
o123456(between@and.ingest) - project:
7890123(after the last/)
- key:
Usage
Basic Setup
Route-Specific Configuration
Apply Sentry only to specific routes:Environment Variables
Store sensitive configuration in environment variables:How It Works
The plugin injects the following script into the<head> section of each rendered HTML page:
Verification
After building your site:- Open a generated HTML file from
dist/static - Verify the Sentry script is present in the
<head>section - Deploy your site
- Trigger a test error in your application
- Check the Sentry dashboard for the error
Testing
To test error tracking:-
Build and serve your static site:
-
Open your browser’s console and trigger an error:
- Check your Sentry dashboard to verify the error was captured
Advanced Configuration
Custom Sentry Options
For more control over Sentry initialization, you may need to create a custom plugin:Sentry with Angular Integration
For tighter Angular integration, consider using Sentry in your Angular application directly:Troubleshooting
Scripts Not Injected
If Sentry scripts are missing:- Verify the plugin is in
defaultPostRenderersor route-specificpostRenderers - Check that configuration is set before the Scully config export
- Ensure no errors during plugin configuration
Configuration Errors
Common configuration errors:setPluginConfig(Sentry, {...}) before using the plugin
key, org, and project, or use dsn
Errors Not Appearing in Sentry
- Verify your DSN is correct
- Check browser console for Sentry initialization errors
- Ensure your site is deployed (local files may have CORS issues)
- Check Sentry project settings and quotas
XMLHttpRequest Errors
The plugin disables XMLHttpRequest tracking by default:Repository
- Package:
@scullyio/scully-plugin-sentry - Repository: GitHub
- Sentry SDK Version: 5.20.1 (default)
See Also
- Google Analytics Plugin - Analytics tracking
- Post-Render Plugins
- Sentry Documentation
- Sentry Angular Integration

