# Session Replay for Laravel

Record what a person did in the browser with rrweb, keep the recording on your own disk and database, and watch it inside your own app behind a gate you define. One Blade directive records; nothing has to be built or published. Free and open source (MIT).

- Repository: [github.com/packstub/session-replay](https://github.com/packstub/session-replay)
- Packagist: [packstub/session-replay](https://packagist.org/packages/packstub/session-replay)
- Support: [GitHub issues](https://github.com/packstub/session-replay/issues)

In a Filament panel, [Filament Session Replay](https://github.com/packstub/filament-session-replay/tree/main/docs) puts the sessions, the player and the masking macros on top of this package.

## Features

- **[One Blade directive](https://packstub.dev/docs/session-replay/recording#the-directive)**: `@sessionReplay` before `</body>` records the page, with nothing to build or publish.
- **[Private by default](https://packstub.dev/docs/session-replay/privacy)**: every input masked, no IP address stored, consent and an anonymous mode when you need them.
- **[Recordings stay with you](https://packstub.dev/docs/session-replay/storage)**: gzip chunks on any filesystem disk (local, S3, R2), the index in five tables on your connection.
- **[Markers on the timeline](https://packstub.dev/docs/session-replay/recording#markers)**: errors, failed Livewire requests, web vitals, rage clicks, page views and your own moments.
- **[Only when something goes wrong](https://packstub.dev/docs/session-replay/recording#recording-only-when-something-goes-wrong)**: keep the last minute in the browser and upload it on an error, after asking if you like.
- **[Small recordings](https://packstub.dev/docs/session-replay/storage#sizes)**: stylesheets stored once, unused attributes dropped, batches gzipped in the browser.
- **[A gate decides who watches](https://packstub.dev/docs/session-replay/watching#the-gate)**: `viewSessionReplay` guards the list, the player and every file behind them.
- **[Identity without a session](https://packstub.dev/docs/session-replay/recording#who-is-recorded)**: who is signed in travels in a signed token, so any guard and any tenancy setup works.
- **[A link in every log line](https://packstub.dev/docs/session-replay/error-tracking)**: the recording's id and URL in Laravel's `Context`.

## Guides

| Guide | What it covers |
| --- | --- |
| [Installation](https://packstub.dev/docs/session-replay/installation) | Requirements, the install command, the directive, the gate, the scheduler, the routes |
| [Recording](https://packstub.dev/docs/session-replay/recording) | The directive and its options, who is recorded, sessions and sampling, markers, the browser API, Livewire, CSP, known limits |
| [Privacy](https://packstub.dev/docs/session-replay/privacy) | What is and is not recorded, masking and blocking, consent, guests, retention, wording for a privacy policy |
| [Watching replays](https://packstub.dev/docs/session-replay/watching) | The `viewSessionReplay` gate, the built-in viewer, the player component, links, models and scopes |
| [Storage](https://packstub.dev/docs/session-replay/storage) | Disk layout, the tables, multi-tenant apps, sizes and limits, pruning, S3 |
| [Error tracking](https://packstub.dev/docs/session-replay/error-tracking) | The recording in Laravel's `Context`, and where it shows up |
| [Configuration](https://packstub.dev/docs/session-replay/configuration) | Every key in `config/session-replay.php` |
