# `PhoenixReplay.Router`
[🔗](https://github.com/elixir-vibe/phoenix_replay/blob/v0.6.2/lib/phoenix_replay/router.ex#L1)

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
    end

## Options

  * `:on_mount` — hooks run before the dashboard's own, typically
    authentication that assigns the current user
  * `:authorize` — a `PhoenixReplay.Authorization` module
  * `: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`)

# `__live_sessions__`

```elixir
@spec __live_sessions__(String.t(), keyword()) ::
  {atom(), atom(), keyword(), keyword()}
```

Builds live session names and options for `phoenix_replay/2`.

Called at router compile time with the dashboard's full path.

# `phoenix_replay`
*macro* 

Defines the dashboard routes under `path`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
