SagentsLiveDebugger.Router
(Sagents LiveDebugger v0.4.0-rc.2)
Copy Markdown
Router macro for mounting the debugger in a Phoenix application.
Options
:coordinator(required) - The coordinator module for managing agent sessions.:pubsub(required) - ThePhoenix.PubSubinstance the host application uses to broadcast agent and presence events. The debugger subscribes toSagents.Subscriber.presence_topic/0and to per-conversation viewer presence topics on this PubSub.:presence_module- Optional presence module for real-time viewer updates.:live_socket_path- Configures the socket path. Must match thesocket "/live", Phoenix.LiveView.Socketin your endpoint. Defaults to"/live".:csp_nonce_assign_key- An assign key to find the CSP nonce value used for assets. Supports eitheratom()(used for both script and style nonces) or a map of type%{optional(:script) => atom(), optional(:style) => atom()}.
Examples
import SagentsLiveDebugger.Router
scope "/dev" do
pipe_through :browser
sagents_live_debugger "/debug/agents",
coordinator: MyApp.Coordinator,
pubsub: MyApp.PubSub,
presence_module: MyAppWeb.Presence
endWith CSP nonces:
sagents_live_debugger "/debug/agents",
coordinator: MyApp.Coordinator,
pubsub: MyApp.PubSub,
csp_nonce_assign_key: :csp_nonce