DOM snapshot
A DOM snapshot is a serialized copy of a web page's document object model at one moment: every element, attribute, and text node converted into a data structure that can be stored and later rebuilt into an identical page. Session replay uses snapshots as the reference frames that events are applied against.
How it works
The serializer walks the live DOM tree and converts each node into JSON, assigning every node a numeric id so later events can reference it. Scripts are neutralized during serialization because replay must show what happened, never re-execute it. Stylesheets are inlined or referenced so the rebuilt page renders correctly. In rrweb this logic lives in the rrweb-snapshot package, which can also be used standalone to take static, JavaScript-free "screenshots" of page state as HTML; the serialization documentation describes the format in more detail.
Where you encounter it
Every recording opens with a snapshot (see full snapshot), and long recordings insert fresh ones periodically (see checkout). Snapshot size dominates storage cost for content-heavy pages; retention, sampling, and compression are the main levers.