All posts

Setting Up Session Replay in Laravel

Set up session replay for Laravel using Bugsly. Quick installation, configuration, and verification steps included.

The Problem

Imagine watching a video of every user who encountered a bug in your Laravel app. That's what session replay gives you — complete visual context for every error.

Quick Start with Bugsly

Getting session replay running in Laravel takes about five minutes. Here's how.

Install the SDK:

composer require bugsly/bugsly-laravel

Add the initialization code:

<?php
// config/bugsly.php
return [
    "dsn" => env("BUGSLY_DSN"),
    "traces_sample_rate" => 1.0,
    "send_default_pii" => true,
];

That's it. Bugsly starts capturing events immediately. No additional configuration is required for basic session replay, though you'll want to customize the setup as your needs grow.

Going Beyond the Basics

The initial setup captures unhandled errors automatically. To get more value from your Laravel integration:

  • Add breadcrumbs to trace user actions leading up to errors. This context is invaluable when debugging complex flows.
  • Set up release health to track crash-free session rates across deployments. You'll know instantly if a release introduces regressions.
  • Configure integrations with your existing tools. Bugsly connects with Slack, PagerDuty, Jira, GitHub, and more to fit into your workflow.

Why Bugsly for Laravel?

Bugsly's Laravel SDK is purpose-built to hook into the framework's internals. It captures framework-specific context, groups errors intelligently using stack trace analysis, and provides a timeline view of events. Your team spends less time reproducing bugs and more time shipping features.

Next Steps

Once session replay is running, configure privacy rules to mask sensitive user data like passwords and credit card fields. Use replay search to find sessions matching specific criteria — like sessions with rage clicks or error events. Connect replays to error reports for instant visual context during debugging.

Try Bugsly Free

AI-powered error tracking that explains your bugs. Set up in 2 minutes, free forever for small projects.

Get Started Free