PostHog.Integrations.Plug (posthog v2.0.0)

View Source

Provides a plug that automatically extracts and sets relevant metadata from Plug.Conn.

For Phoenix apps, add it to your endpoint.ex somewhere before your router:

plug PostHog.Integrations.Plug

For Plug apps, add it directly to your router:

defmodule MyRouterPlug do
  use Plug.Router

  plug PostHog.Integrations.Plug
  plug :match
  plug :dispatch

  ...
end