PHPackages                             gemz/useragent - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. gemz/useragent

ActiveLibrary

gemz/useragent
==============

This package is an easy wrapper for the Piwik Device Detector

2.0.0(3y ago)1449MITPHPPHP ^8.0.2CI failing

Since Jan 26Pushed 3y agoCompare

[ Source](https://github.com/gemzio/useragent)[ Packagist](https://packagist.org/packages/gemz/useragent)[ Docs](https://github.com/gemzio/useragent)[ Patreon](https://www.patreon.com/stefanriehl)[ RSS](/packages/gemz-useragent/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (3)Versions (12)Used By (0)

Gemz Useragent Parser
=====================

[](#gemz-useragent-parser)

[![Latest Version on Packagist](https://camo.githubusercontent.com/097a845bd1432061436b85268011e8a41beda0115225503f3b43abf46285aeaf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67656d7a2f757365726167656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gemz/useragent)[![GitHub Tests Action Status](https://camo.githubusercontent.com/e20561e0a6f631df03e98763200a571af594ac6516c2c0d7ae6775d08057ec22/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f67656d7a696f2f757365726167656e742f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/gemzio/useragent/actions?query=workflow%3Arun-tests+branch%3Amaster)[![Quality Score](https://camo.githubusercontent.com/a5286a02e57754976b91c267f604437fd82f24fe3962ddb9a3f1a44afd62d7fb/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f67656d7a696f2f757365726167656e742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/gemzio/useragent)[![Total Downloads](https://camo.githubusercontent.com/2211411690d6d3cf58b8bf124016f422127e4b9e414fd549e30790d8641f3f81/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f67656d7a2f757365726167656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gemz/useragent)

This package uses the [Piwik Device Detector Package](https://github.com/matomo-org/device-detector) and builds a thin wrapper around it.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require gemz/useragent
```

Usage
-----

[](#usage)

```
use Gemz\Useragent;

// static instantiation
$parser = Useragent::agent($string);

// object instantiation
$parser = new Useragent($string);

// Get Result
$result = $parser->result(); // returns array

[
    'isBot' => false,
    'browserType' => 'browser',
    'browserEngine' => 'Blink',
    'browserName' => 'Chrome',
    'browserVersion' => '79.0',
    'device' => 'desktop',
    'deviceModel' => '',
    'deviceBrand' => '',
    'os' => 'Mac',
    'isMobile' => false,
]

// Set a new useragent
$result = $parser
    ->for($string)
    ->result();

// If you need full access to the piwik device detector instance
$detector = $parser->parser(); // returns DeviceDetector\DeviceDetector;
$detector->...
```

### Testing

[](#testing)

```
# unit tests
composer test

# you'll need a driver for code coverage
composer test-coverage
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Stefan Riehl](https://github.com/stefanriehl)

Support us
----------

[](#support-us)

Gemz.io is maintained by [Stefan Riehl](https://github.com/stefanriehl). You'll find all open source projects on [Gemz.io github](https://github.com/gemzio).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~98 days

Recently: every ~231 days

Total

11

Last Release

1321d ago

Major Versions

0.9.x-dev → v1.0.02020-02-16

1.1.0 → 2.0.x-dev2022-10-05

PHP version history (3 changes)v0.9.0PHP ^7.2

1.1.x-devPHP ^7.2|^8.0

2.0.x-devPHP ^8.0.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/4265046f24e014f773ad4f7cb289fb27b313d75f2810085462b7bd590d963ebe?d=identicon)[stefanriehl](/maintainers/stefanriehl)

---

Top Contributors

[![stefanriehl](https://avatars.githubusercontent.com/u/50109920?v=4)](https://github.com/stefanriehl "stefanriehl (1 commits)")

---

Tags

php7useragentparseruseragentgemz

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gemz-useragent/health.svg)

```
[![Health](https://phpackages.com/badges/gemz-useragent/health.svg)](https://phpackages.com/packages/gemz-useragent)
```

###  Alternatives

[jenssegers/agent

Desktop/mobile user agent parser with support for Laravel, based on Mobiledetect

4.8k67.8M440](/packages/jenssegers-agent)[matomo/device-detector

The Universal Device Detection library, that parses User Agents and detects devices (desktop, tablet, mobile, tv, cars, console, etc.), clients (browsers, media players, mobile apps, feed readers, libraries, etc), operating systems, devices, brands and models.

3.5k23.5M111](/packages/matomo-device-detector)[whichbrowser/parser

Useragent sniffing library for PHP

1.8k11.6M50](/packages/whichbrowser-parser)[donatj/phpuseragentparser

Lightning fast, minimalist PHP UserAgent string parser.

60417.1M60](/packages/donatj-phpuseragentparser)[foroco/php-browser-detection

Ultra fast PHP library to detect browser, OS, platform and device type by User-Agent parsing

1554.7M7](/packages/foroco-php-browser-detection)[thadafinser/user-agent-parser

UserAgent parsing done right http://useragent.mkf.solutions/

249316.9k2](/packages/thadafinser-user-agent-parser)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
