The browser and the visit a recording came from, when the browser told
PhoenixReplay (see PhoenixReplay.Capture.Browser):
:viewport—%{width: integer, height: integer, dpr: number}when the LiveView connected; later changes are:viewportevents:user_agent— theUser-Agentheader, when the endpoint's socket lists:user_agentin its:connect_info:tab— an id of the browser tab, shared by the tab's sessions:navigated_from— the URL of the LiveView that live-navigated here:headers— request headers listed in the:clientconfig, kept byPhoenixReplay.Plug:landing— the visit's first request, when the:clientconfig asks for it; seePhoenixReplay.Recording.Client.Landing
Its functions describe the device, named from its user agent with
UAParser, and where the visit came from.
Summary
Types
The kind of device a session ran on, by its viewport's width; see device_type/1.
Functions
The browser in a user agent, without its version, such as "Mobile Safari", or nil when it is not recognized.
Describes a landing's campaign as "google / cpc / spring_sale", from
its UTM source, medium and campaign, or returns nil without them.
Reads a viewport written by encode_viewport/1, or nil.
The viewport a recording without one is shown at, such as in an export.
Names the browser, with its major version, and the system in a user
agent, such as "Mobile Safari 18 on iOS", or returns nil when neither
is recognized.
The kind of device a viewport belongs to, by its width in CSS pixels:
"phone" below 640, "tablet" below 1024, "desktop" otherwise, or
nil without a viewport.
The kinds of device device_type/1 tells apart.
Writes a viewport as "390x844@3", compact for storing alongside a
summary, or nil.
A viewport's media settings as the CSS media features they are, for the
replay to apply to the replayed page's media rules: %{"pointer" => "coarse", "prefers-color-scheme" => "dark", ...}, with those the browser
did not report left out.
A viewport's orientation as CSS's orientation media feature tells it:
portrait when it is at least as tall as it is wide.
The host of a referrer URL, such as "news.ycombinator.com", or nil.
Where the visit came from, as Google Analytics tells it; see
PhoenixReplay.Recording.Traffic.
Brings a client context stored by an earlier version up to date: plain
maps before 0.6, which named :navigated_from :referer.
Types
@type device_type() :: String.t()
The kind of device a session ran on, by its viewport's width; see device_type/1.
@type t() :: %PhoenixReplay.Recording.Client{ headers: %{required(String.t()) => String.t()}, landing: PhoenixReplay.Recording.Client.Landing.t() | nil, navigated_from: String.t() | nil, tab: String.t() | nil, user_agent: String.t() | nil, viewport: PhoenixReplay.Recording.viewport() | nil }
Functions
The browser in a user agent, without its version, such as "Mobile Safari", or nil when it is not recognized.
Describes a landing's campaign as "google / cpc / spring_sale", from
its UTM source, medium and campaign, or returns nil without them.
@spec decode_viewport(String.t() | nil) :: PhoenixReplay.Recording.viewport() | nil
Reads a viewport written by encode_viewport/1, or nil.
@spec default_viewport() :: PhoenixReplay.Recording.viewport()
The viewport a recording without one is shown at, such as in an export.
Names the browser, with its major version, and the system in a user
agent, such as "Mobile Safari 18 on iOS", or returns nil when neither
is recognized.
@spec device_type(PhoenixReplay.Recording.viewport() | nil) :: device_type() | nil
The kind of device a viewport belongs to, by its width in CSS pixels:
"phone" below 640, "tablet" below 1024, "desktop" otherwise, or
nil without a viewport.
@spec device_types() :: [device_type()]
The kinds of device device_type/1 tells apart.
@spec encode_viewport(PhoenixReplay.Recording.viewport() | nil) :: String.t() | nil
Writes a viewport as "390x844@3", compact for storing alongside a
summary, or nil.
@spec media(PhoenixReplay.Recording.viewport() | nil) :: %{ required(String.t()) => String.t() }
A viewport's media settings as the CSS media features they are, for the
replay to apply to the replayed page's media rules: %{"pointer" => "coarse", "prefers-color-scheme" => "dark", ...}, with those the browser
did not report left out.
@spec orientation(%{ :width => pos_integer(), :height => pos_integer(), optional(atom()) => term() }) :: :portrait | :landscape
A viewport's orientation as CSS's orientation media feature tells it:
portrait when it is at least as tall as it is wide.
The host of a referrer URL, such as "news.ycombinator.com", or nil.
@spec traffic(t()) :: PhoenixReplay.Recording.Traffic.t()
Where the visit came from, as Google Analytics tells it; see
PhoenixReplay.Recording.Traffic.
Brings a client context stored by an earlier version up to date: plain
maps before 0.6, which named :navigated_from :referer.