Router module expected to be used with a Phoenix router.
Examples
defmodule MyAppWeb.Router do
use MyAppWeb, :router
use Inngest.Router, :phoenix
scope "/" do
pipe_through(:api)
inngest("/api/inngest", client: MyApp.Inngest)
end
endInngest verifies inbound request signatures against the raw request body. In
Phoenix applications, configure Plug.Parsers with
Inngest.CacheBodyReader in your endpoint so the router can verify signed
requests:
plug Plug.Parsers,
parsers: [:urlencoded, :json],
pass: ["*/*"],
body_reader: {Inngest.CacheBodyReader, :read_body, [[paths: ["/api/inngest"]]]},
json_decoder: Phoenix.json_library()
plug MyAppWeb.RouterPlug's multipart parser does not use the :body_reader option. Inngest
signed requests are JSON, so the :json parser is the important one for
signature verification.