Skip to content

Commit

Permalink
Better explain client hints in readme
Browse files Browse the repository at this point in the history
fixes #7909
  • Loading branch information
sgiehl authored Nov 12, 2024
1 parent 985eaad commit aab8aa0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ use DeviceDetector\Parser\Device\AbstractDeviceParser;
AbstractDeviceParser::setVersionTruncation(AbstractDeviceParser::VERSION_TRUNCATION_NONE);

$userAgent = $_SERVER['HTTP_USER_AGENT']; // change this to the useragent you want to parse
$clientHints = ClientHints::factory($_SERVER); // client hints are optional

// Client Hints are optional
// If you want to use them your server must announce that it supports client hints, using the Accept-CH header to specify the hints that it is interested in receiving.
// See e.g. https://developer.mozilla.org/en-US/docs/Web/HTTP/Client_hints
$clientHints = ClientHints::factory($_SERVER);

$dd = new DeviceDetector($userAgent, $clientHints);

Expand Down

0 comments on commit aab8aa0

Please sign in to comment.