LiveView lifecycle hook that records session state transitions.
Usage as on_mount hook
live_session :default, on_mount: [PhoenixReplay.Recorder] do
live "/dashboard", DashboardLive
endManual attachment
def mount(_params, _session, socket) do
{:ok, PhoenixReplay.Recorder.attach(socket)}
end
Summary
Functions
Manually attach recording to a socket. Use when not using on_mount.
on_mount callback. Automatically attaches recording hooks.
Functions
Manually attach recording to a socket. Use when not using on_mount.
Pass params and session from your mount/3 to capture them in the
recording. If omitted, they are recorded as empty maps.
Examples
def mount(params, session, socket) do
{:ok, PhoenixReplay.Recorder.attach(socket, params, session)}
end
on_mount callback. Automatically attaches recording hooks.