Bugsnag Error Tracking Setup for Web Application

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1221
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1163
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    855
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1058
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    828
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    825

Setting Up Error Tracking (Bugsnag) for Your Web Application

Bugsnag is a commercial alternative to Sentry with focus on release stability. Key metric — Stability Score: percentage of sessions without errors. More convenient than raw error counts when deciding if a release is ready to ship.

Free plan: 7500 errors/month for 1 project.

Installation PHP / Laravel

composer require bugsnag/bugsnag-laravel
php artisan bugsnag:install your-api-key-here

In .env:

BUGSNAG_API_KEY=your_32_char_api_key
BUGSNAG_APP_VERSION=1.0.0
BUGSNAG_RELEASE_STAGE=production

config/bugsnag.php after publishing:

return [
    'api_key' => env('BUGSNAG_API_KEY'),
    'app_version' => env('BUGSNAG_APP_VERSION'),
    'release_stage' => env('BUGSNAG_RELEASE_STAGE', 'production'),
    'notify_release_stages' => ['production', 'staging'],
    'filters' => ['password', 'token', 'secret', 'api_key'],
    'notify_endpoint' => 'https://notify.bugsnag.com',
    'sessions_endpoint' => 'https://sessions.bugsnag.com',
    'auto_capture_sessions' => true,
];

Service Provider registers automatically. In app/Exceptions/Handler.php for Laravel 9-10:

use Bugsnag\BugsnagLaravel\Facades\Bugsnag;

public function register(): void
{
    $this->reportable(function (Throwable $e) {
        Bugsnag::notifyException($e);
    });
}

Context and Metadata

use Bugsnag\BugsnagLaravel\Facades\Bugsnag;

// Set user (automatically if auth configured)
Bugsnag::setUser([
    'id' => $user->id,
    'name' => $user->name,
    'email' => $user->email,
]);

// Add custom tabs to report
Bugsnag::registerCallback(function ($report) {
    $report->setMetaData([
        'subscription' => [
            'plan' => auth()->user()?->plan,
            'trial_ends' => auth()->user()?->trial_ends_at,
        ],
    ]);
});

// Manual submission with additional data
Bugsnag::notifyException(
    new \RuntimeException('Stripe webhook failed'),
    function ($report) use ($payload) {
        $report->setSeverity('warning');
        $report->setMetaData(['webhook' => ['event' => $payload['type']]]);
    }
);

JavaScript / React

npm install @bugsnag/js @bugsnag/plugin-react
// src/bugsnag.ts
import Bugsnag from '@bugsnag/js';
import BugsnagPluginReact from '@bugsnag/plugin-react';
import React from 'react';

Bugsnag.start({
  apiKey: import.meta.env.VITE_BUGSNAG_API_KEY,
  plugins: [new BugsnagPluginReact()],
  releaseStage: import.meta.env.MODE,
});

export const ErrorBoundary = Bugsnag.getPlugin('react')
  ?.createErrorBoundary(React);

Dashboard gives quick insights into stability trends per release.

Timeline

Basic setup for backend and frontend: 1-2 hours. Full integration with release tracking and custom reporting: 3-4 hours.