Expand description
Generate context data from user agent and client hints.
This module is responsible for taking the user agent string parsing it and filling in the browser, os and device information in the event.
§NOTICE
Adding user_agent parsing to your module will incur a latency penalty in the test suite. Because of this some integration tests may fail. To fix this, you will need to add a timeout to your consumer.
Structs§
- Client
Hints - The client hint variable names mirror the name of the “SEC-CH” headers.
- RawUser
Agent Info - A container housing both the user-agent string and the client hint headers.
Traits§
- From
User Agent Info - Computes a
Context
from either a user agent string and client hints.
Functions§
- browser_
from_ client_ hints - The sec-ch-ua field looks something like this: “Not_A Brand”;v=“99”, “Google Chrome”;v=“109”, “Chromium”;v=“109” The order of the items are randomly shuffled.
- normalize_
user_ agent - Generates context data from client hints or user agent.
- normalize_
user_ agent_ info_ generic - Low-level version of
normalize_user_agent
operating on parts.