> ## Documentation Index
> Fetch the complete documentation index at: https://docs.traceback.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Session Replay Tuning

> Optimize replay sample rates, DOM canvas captures, and network bandwidth usage.

Session Replay captures DOM mutations and mouse activity. To optimize quota and performance:

## Recommended Sampling Strategy

* **100% of Error Sessions**: Set `replaysOnErrorSampleRate: 1.0` so any session encountering an error is preserved.
* **1-5% of Normal Sessions**: Set `replaysSessionSampleRate: 0.02` for qualitative UX insights without excessive data consumption.

```typescript theme={null}
Traceback.init({
  dsn: "https://tb_live_key@ingest.traceback.dev/1",
  replaysSessionSampleRate: 0.02,
  replaysOnErrorSampleRate: 1.0,
});
```

***

## Blocking Media & Canvas

To prevent high network usage from large canvas elements or embedded videos:

```typescript theme={null}
new Traceback.Replay({
  blockAllMedia: true,
  maskAllInputs: true,
});
```
