Mounts the PhoenixReplay dashboard in a Phoenix router.
defmodule MyAppWeb.Router do
use Phoenix.Router
import PhoenixReplay.Router
scope "/admin" do
pipe_through [:browser, :require_admin]
phoenix_replay "/replay",
on_mount: [{MyAppWeb.UserAuth, :ensure_admin}],
authorize: MyApp.ReplayAuthorization
end
endOptions
:on_mount— hooks run before the dashboard's own, typically authentication that assigns the current user:authorize— aPhoenixReplay.Authorizationmodule:frame_layout—{module, function}root layout for the replay frame, which renders your recorded views. Defaults to a layout that loads your endpoint's/assets/css/app.css:live_socket_path— your endpoint's LiveView socket path (default"/live"):as— live session name prefix, needed only when mounting the dashboard more than once (default:phoenix_replay)
Summary
Functions
Builds live session names and options for phoenix_replay/2.
Defines the dashboard routes under path.
Functions
Builds live session names and options for phoenix_replay/2.
Called at router compile time with the dashboard's full path.
Defines the dashboard routes under path.