Starts what exports need with the first export, under this supervisor:
PhoenixReplay.Web.Export.Endpoint and a connection to Playwright, so
an application that never exports runs neither.
The endpoint listens on 127.0.0.1 and a free port, with a secret made
when it starts and given to it as an argument rather than kept in the
application environment. Tokens for the stage are signed with that
secret, so they die with the endpoint; stage_url/3 makes one for a
recording, and verify/2 reads it.
Summary
Functions
Returns a specification to start this module under a supervisor.
Starts the endpoint and Playwright unless they run, and tells where they are.
The address of the stage for a recording, with a token that opens it, and whether the export draws the pointer.
Starts the endpoint with its configuration as arguments: a loopback address, a free port, and secrets made for this start. Children start one at a time, so only the start that starts it makes the secret.
Starts the supervisor the endpoint and Playwright are started under on demand.
Reads a stage token with the endpoint that serves the stage.
Types
@type t() :: %{url: String.t(), connection: GenServer.name()}
Where the browser loads the stage from, and the Playwright connection.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec ensure(PhoenixReplay.Config.export()) :: {:ok, t()} | {:error, term()}
Starts the endpoint and Playwright unless they run, and tells where they are.
@spec stage_url(t(), PhoenixReplay.Recording.id(), PhoenixReplay.Export.Options.t()) :: String.t()
The address of the stage for a recording, with a token that opens it, and whether the export draws the pointer.
@spec start_endpoint() :: Supervisor.on_start()
Starts the endpoint with its configuration as arguments: a loopback address, a free port, and secrets made for this start. Children start one at a time, so only the start that starts it makes the secret.
@spec start_link(keyword()) :: Supervisor.on_start()
Starts the supervisor the endpoint and Playwright are started under on demand.
@spec verify(module(), String.t()) :: {:ok, PhoenixReplay.Recording.id()} | {:error, atom()}
Reads a stage token with the endpoint that serves the stage.