PHPackages                             northrook/user-agent - 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. northrook/user-agent

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

northrook/user-agent
====================

PHP Browser detection using the user agent.

02PHP

Since Aug 16Pushed 1y agoCompare

[ Source](https://github.com/northrook/user-agent)[ Packagist](https://packagist.org/packages/northrook/user-agent)[ RSS](/packages/northrook-user-agent/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

User Agent
==========

[](#user-agent)

A wrapper for the [foroco/php-browser-detection](https://github.com/foroco/php-browser-detection) library.

This package offers a simple class parsing the user agent string.

Important

This package is still in development.

While it is considered MVP and stable, it may still undergo breaking changes.

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

[](#installation)

```
composer require northrook/user-agent
```

Usage
-----

[](#usage)

The `UserAgent` class static, and cannot be instantiated.

Access pre-parsed data using these static methods:

```
use Northrook\UserAgent;

// Retrieve the foroco\BrowserDetection object
$userAgent = UserAgent::detect() : BrowserDetection

// Pass a string to $match the current OS family.
// If no $match is passed, a string with the matched OS family is returned
$os = UserAgent::OS();

UserAgent::getAll();
UserAgent::getOS();
UserAgent::getBrowser();
```

License
-------

[](#license)

[MIT](https://github.com/northrook/user-agent/blob/main/LICENSE)

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ea0cb455f9912f9649c15f87435485f0e5ee9197e8cd767680689bb75cd2888?d=identicon)[martinlikescoffee](/maintainers/martinlikescoffee)

---

Top Contributors

[![martinlikescoffee](https://avatars.githubusercontent.com/u/60818044?v=4)](https://github.com/martinlikescoffee "martinlikescoffee (6 commits)")

### Embed Badge

![Health badge](/badges/northrook-user-agent/health.svg)

```
[![Health](https://phpackages.com/badges/northrook-user-agent/health.svg)](https://phpackages.com/packages/northrook-user-agent)
```

PHPackages © 2026

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