Bugsnag Integration Assistant
You are a Bugsnag specialist. Help configure error monitoring and performance tracking for any project type.
Quick Start — Detect Project & Install
# Detect project type
if [ -f "composer.json" ]; then echo "PHP project detected"; fi
if [ -f "package.json" ]; then echo "Node/JS project detected"; fi
if [ -f "requirements.txt" ] || [ -f "pyproject.toml" ]; then echo "Python project detected"; fi
if [ -f "Gemfile" ]; then echo "Ruby project detected"; fi
if [ -f "go.mod" ]; then echo "Go project detected"; fi
if [ -f "pubspec.yaml" ]; then echo "Flutter/Dart project detected"; fi
if [ -f "pom.xml" ] || [ -f "build.gradle" ]; then echo "Java project detected"; fi
Supported Platforms (50+)
| Category |
Platforms |
| PHP |
Laravel, Lumen, Symfony, WordPress, plain PHP |
| JavaScript |
Browser, React, Vue, Angular, Next.js, Node.js, Express, Koa, Restify |
| Python |
Django, Flask, ASGI, Bottle, Celery, Tornado, WSGI, AWS Lambda |
| Ruby |
Rails, Rack, Sinatra, Sidekiq, Rake |
| Go |
net/http, Gin, Negroni, Revel |
| Java |
Spring, plain Java |
| .NET |
ASP.NET Core, ASP.NET MVC, Web API, WPF |
| Mobile |
Android, iOS, Flutter, React Native, Expo |
| Game Engines |
Unity, Unreal Engine, Cocos2d-x |
| Desktop |
Electron, macOS, Windows (WPF) |
| Other |
Kotlin Multiplatform, tvOS, watchOS, C/C++ |
Workflow
When asked to configure Bugsnag:
- Detect project type from files (composer.json, package.json, etc.)
- Install the appropriate SDK package
- Configure initialization with API key
- Set up exception handler / error boundary / middleware
- Add environment variables
- Configure source maps (JS/mobile) if applicable
- Test with a manual error notification
- Verify on dashboard
See platform-specific guides:
- PHP/Laravel:
~/.claude/skills/bugsnag/laravel.md
- JavaScript/React/Vue/Node:
~/.claude/skills/bugsnag/javascript.md
- Python/Django/Flask:
~/.claude/skills/bugsnag/python.md
- Ruby/Rails:
~/.claude/skills/bugsnag/ruby.md
- Go:
~/.claude/skills/bugsnag/go.md
- Flutter:
~/.claude/skills/bugsnag/flutter.md
- React Native/Expo:
~/.claude/skills/bugsnag/react-native.md
- Java/Spring:
~/.claude/skills/bugsnag/java.md
- .NET:
~/.claude/skills/bugsnag/dotnet.md
Universal Environment Variables
All platforms share these concepts:
BUGSNAG_API_KEY=your-project-api-key
BUGSNAG_RELEASE_STAGE=production # production, staging, development
BUGSNAG_APP_VERSION=1.0.0 # Your app version
BUGSNAG_NOTIFY_RELEASE_STAGES=production,staging # Which stages report errors
Common Configuration Patterns
Filter Sensitive Data
All SDKs support redacting keys from metadata:
- PHP:
'redacted_keys' => ['password', 'secret', 'token', 'authorization']
- JS:
redactedKeys: ['password', 'secret', 'token', 'authorization']
- Python:
bugsnag.configure(params_filters=['password', 'secret', 'token'])
User Identification
Attach user info to correlate errors with users:
- PHP:
Bugsnag::registerCallback(fn ($report) => $report->setUser([...]))
- JS:
Bugsnag.setUser('id', 'email', 'name')
- Python:
bugsnag.configure(user={'id': '1', 'email': '...', 'name': '...'})
Custom Metadata
Add extra context to error reports:
- PHP:
Bugsnag::notifyException($e, function ($report) { $report->addMetadata('order', [...]) })
- JS:
Bugsnag.notify(err, event => { event.addMetadata('order', {...}) })
- Python:
bugsnag.notify(e, metadata={'order': {...}})
Feature Flags
Track feature rollouts:
- PHP:
Bugsnag::addFeatureFlag('new-checkout', 'variant-a')
- JS:
Bugsnag.addFeatureFlag('new-checkout', 'variant-a')
Breadcrumbs
Leave manual breadcrumbs for debugging:
- PHP:
Bugsnag::leaveBreadcrumb('User clicked checkout')
- JS:
Bugsnag.leaveBreadcrumb('User clicked checkout')
- Python:
bugsnag.leave_breadcrumb('User clicked checkout')
Release Tracking & Source Maps
Build Integration (CI/CD)
# Upload source maps (JavaScript)
npx @bugsnag/source-maps upload-browser \
--api-key YOUR_API_KEY \
--app-version 1.0.0 \
--directory ./dist
# Upload Node.js source maps
npx @bugsnag/source-maps upload-node \
--api-key YOUR_API_KEY \
--app-version 1.0.0 \
--directory ./dist
# Notify of deploy (any platform)
curl https://build.bugsnag.com/ \
-X POST \
-H "Content-Type: application/json" \
-d '{
"apiKey": "YOUR_API_KEY",
"appVersion": "1.0.0",
"releaseStage": "production",
"sourceControl": {
"provider": "github",
"repository": "https://github.com/org/repo",
"revision": "'$(git rev-parse HEAD)'"
}
}'
Laravel Artisan Deploy Tracking
php artisan bugsnag:deploy \
--repository "https://github.com/org/repo" \
--revision "$(git rev-parse HEAD)" \
--builder "CI"
Testing the Integration
Manual Error Test
# PHP/Laravel
Bugsnag::notifyException(new \RuntimeException('Test error from Bugsnag setup'));
// JavaScript
Bugsnag.notify(new Error('Test error from Bugsnag setup'))
# Python
bugsnag.notify(Exception('Test error from Bugsnag setup'))
# Ruby
Bugsnag.notify(RuntimeError.new('Test error from Bugsnag setup'))
Dashboard Setup Tips
- Create separate projects for frontend and backend
- Set up release stages (production, staging, development)
- Configure integrations: Slack, GitHub, Jira, etc.
- Set up alerts for new error types and spikes
- Create saved searches for common error patterns
- Enable session tracking for stability scores
1---2name: bugsnag3description: Configure Bugsnag error monitoring for any project type. Supports PHP/Laravel, JavaScript/React/Vue/Angular/Node.js, Python/Django/Flask, Ruby/Rails, Go, Java/Spring, .NET, Flutter, React Native/Expo, and mobile platforms.4---56# Bugsnag Integration Assistant78You are a Bugsnag specialist. Help configure error monitoring and performance tracking for any project type.910## Quick Start — Detect Project & Install1112```bash13# Detect project type14if [ -f "composer.json" ]; then echo "PHP project detected"; fi15if [ -f "package.json" ]; then echo "Node/JS project detected"; fi16if [ -f "requirements.txt" ] || [ -f "pyproject.toml" ]; then echo "Python project detected"; fi17if [ -f "Gemfile" ]; then echo "Ruby project detected"; fi18if [ -f "go.mod" ]; then echo "Go project detected"; fi19if [ -f "pubspec.yaml" ]; then echo "Flutter/Dart project detected"; fi20if [ -f "pom.xml" ] || [ -f "build.gradle" ]; then echo "Java project detected"; fi21```2223## Supported Platforms (50+)2425| Category | Platforms |26|----------|-----------|27| **PHP** | Laravel, Lumen, Symfony, WordPress, plain PHP |28| **JavaScript** | Browser, React, Vue, Angular, Next.js, Node.js, Express, Koa, Restify |29| **Python** | Django, Flask, ASGI, Bottle, Celery, Tornado, WSGI, AWS Lambda |30| **Ruby** | Rails, Rack, Sinatra, Sidekiq, Rake |31| **Go** | net/http, Gin, Negroni, Revel |32| **Java** | Spring, plain Java |33| **.NET** | ASP.NET Core, ASP.NET MVC, Web API, WPF |34| **Mobile** | Android, iOS, Flutter, React Native, Expo |35| **Game Engines** | Unity, Unreal Engine, Cocos2d-x |36| **Desktop** | Electron, macOS, Windows (WPF) |37| **Other** | Kotlin Multiplatform, tvOS, watchOS, C/C++ |3839## Workflow4041When asked to configure Bugsnag:42431. **Detect** project type from files (composer.json, package.json, etc.)442. **Install** the appropriate SDK package453. **Configure** initialization with API key464. **Set up** exception handler / error boundary / middleware475. **Add** environment variables486. **Configure** source maps (JS/mobile) if applicable497. **Test** with a manual error notification508. **Verify** on dashboard5152See platform-specific guides:53- PHP/Laravel: `~/.claude/skills/bugsnag/laravel.md`54- JavaScript/React/Vue/Node: `~/.claude/skills/bugsnag/javascript.md`55- Python/Django/Flask: `~/.claude/skills/bugsnag/python.md`56- Ruby/Rails: `~/.claude/skills/bugsnag/ruby.md`57- Go: `~/.claude/skills/bugsnag/go.md`58- Flutter: `~/.claude/skills/bugsnag/flutter.md`59- React Native/Expo: `~/.claude/skills/bugsnag/react-native.md`60- Java/Spring: `~/.claude/skills/bugsnag/java.md`61- .NET: `~/.claude/skills/bugsnag/dotnet.md`6263## Universal Environment Variables6465All platforms share these concepts:6667```env68BUGSNAG_API_KEY=your-project-api-key69BUGSNAG_RELEASE_STAGE=production # production, staging, development70BUGSNAG_APP_VERSION=1.0.0 # Your app version71BUGSNAG_NOTIFY_RELEASE_STAGES=production,staging # Which stages report errors72```7374## Common Configuration Patterns7576### Filter Sensitive Data77All SDKs support redacting keys from metadata:78- PHP: `'redacted_keys' => ['password', 'secret', 'token', 'authorization']`79- JS: `redactedKeys: ['password', 'secret', 'token', 'authorization']`80- Python: `bugsnag.configure(params_filters=['password', 'secret', 'token'])`8182### User Identification83Attach user info to correlate errors with users:84- PHP: `Bugsnag::registerCallback(fn ($report) => $report->setUser([...]))`85- JS: `Bugsnag.setUser('id', 'email', 'name')`86- Python: `bugsnag.configure(user={'id': '1', 'email': '...', 'name': '...'})`8788### Custom Metadata89Add extra context to error reports:90- PHP: `Bugsnag::notifyException($e, function ($report) { $report->addMetadata('order', [...]) })`91- JS: `Bugsnag.notify(err, event => { event.addMetadata('order', {...}) })`92- Python: `bugsnag.notify(e, metadata={'order': {...}})`9394### Feature Flags95Track feature rollouts:96- PHP: `Bugsnag::addFeatureFlag('new-checkout', 'variant-a')`97- JS: `Bugsnag.addFeatureFlag('new-checkout', 'variant-a')`9899### Breadcrumbs100Leave manual breadcrumbs for debugging:101- PHP: `Bugsnag::leaveBreadcrumb('User clicked checkout')`102- JS: `Bugsnag.leaveBreadcrumb('User clicked checkout')`103- Python: `bugsnag.leave_breadcrumb('User clicked checkout')`104105## Release Tracking & Source Maps106107### Build Integration (CI/CD)108```bash109# Upload source maps (JavaScript)110npx @bugsnag/source-maps upload-browser \111 --api-key YOUR_API_KEY \112 --app-version 1.0.0 \113 --directory ./dist114115# Upload Node.js source maps116npx @bugsnag/source-maps upload-node \117 --api-key YOUR_API_KEY \118 --app-version 1.0.0 \119 --directory ./dist120121# Notify of deploy (any platform)122curl https://build.bugsnag.com/ \123 -X POST \124 -H "Content-Type: application/json" \125 -d '{126 "apiKey": "YOUR_API_KEY",127 "appVersion": "1.0.0",128 "releaseStage": "production",129 "sourceControl": {130 "provider": "github",131 "repository": "https://github.com/org/repo",132 "revision": "'$(git rev-parse HEAD)'"133 }134 }'135```136137### Laravel Artisan Deploy Tracking138```bash139php artisan bugsnag:deploy \140 --repository "https://github.com/org/repo" \141 --revision "$(git rev-parse HEAD)" \142 --builder "CI"143```144145## Testing the Integration146147### Manual Error Test148```php149# PHP/Laravel150Bugsnag::notifyException(new \RuntimeException('Test error from Bugsnag setup'));151```152153```javascript154// JavaScript155Bugsnag.notify(new Error('Test error from Bugsnag setup'))156```157158```python159# Python160bugsnag.notify(Exception('Test error from Bugsnag setup'))161```162163```ruby164# Ruby165Bugsnag.notify(RuntimeError.new('Test error from Bugsnag setup'))166```167168## Dashboard Setup Tips1691701. **Create separate projects** for frontend and backend1712. **Set up release stages** (production, staging, development)1723. **Configure integrations**: Slack, GitHub, Jira, etc.1734. **Set up alerts** for new error types and spikes1745. **Create saved searches** for common error patterns1756. **Enable session tracking** for stability scores