navigation_history v0.2.0 NavigationHistory.Tracker
A plug to track user navigation history.
Visited paths will be stored in the session by the plug.
The paths can then be accessed with NavigationHistory.last_path
and
NavigationHistory.last_paths
.
The session must already be fetched with Plug.Conn.fetch_session/1
.
Options
excluded_paths
- The list of paths which should not be tracked. For example,/login
or similar for a lot of apps. Defaults to[]
included_paths
- Limits list the paths to be tracked when set.excluded_paths
is ignored if set.methods
- The list methods which should be tracked. Defaults to["GET"]
history_size
- The number of history entries to track inlast_paths
. Defaults to10
.key
- The key used to track the navigation. It can also be passed tolast_path
andlast_paths
to retrieve the paths for the relevant key. Defaults to"default"
.
Examples
plug NavigationHistory.Tracker, excluded_paths: ["/login", ~r(/admin.*)], history_size: 5