# `Chime.Router.Admin`
[🔗](https://github.com/hattoriai/chime/blob/v0.1.0-dev/lib/chime/router/admin.ex#L1)

The admin, mounted with `chime_admin/2` (imported with `Chime.Router`):
a person's notifications and their log, the events, the deliveries
that failed and a way to send them again.

    scope "/admin" do
      pipe_through [:browser, :require_admin]

      chime_admin "/notifications",
        access: MyAppWeb.ChimeAdminAccess,
        on_mount: [{MyAppWeb.AdminAuth, :require_admin}]
    end

`:access` is a module of `Chime.Admin.Access`, asked on the request of
the page: Chime fails closed, and the admin is a 404 to anyone it does
not allow. Mount it behind the app's admin pipeline and its `on_mount`
all the same.

# `chime_admin`
*macro* 

Mounts Chime.Router.Admin at `path` in a host router.

    import Chime.Router.Admin

    scope "/" do
      pipe_through :browser
      chime_admin "/chime"
    end

## Options

* `:access` (`t:atom/0`) - Required. The app's `Chime.Admin.Access`: who may see the admin.

* `:otp_app` (`t:atom/0`) - The app whose notifiers the previews show: its modules of `Chime.Notifier` with `preview/0`. Without it, the notifiers loaded.

Every mount also takes the options listed in `PhoenixMountable`, such as
`:as`, `:on_mount` and `:csp_nonce_assign_key`.

---

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