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. [Utility &amp; Helpers](/categories/utility)
4. /
5. gemz/useragent

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

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 3w 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 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity69

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

1367d 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

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[jenssegers/agent

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

4.8k72.3M513](/packages/jenssegers-agent)[whichbrowser/parser

Useragent sniffing library for PHP

1.8k12.7M59](/packages/whichbrowser-parser)[foroco/php-browser-detection

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

1545.5M7](/packages/foroco-php-browser-detection)[woothee/woothee

Cross-language UserAgent classifier library, PHP implementation

107649.1k4](/packages/woothee-woothee)[karmendra/laravel-agent-detector

Laravel wrapper for matomo-org/device-detector user agent parser

1249.6k](/packages/karmendra-laravel-agent-detector)

PHPackages © 2026

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