PHPackages                             pikanji/agent-plugin - 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. pikanji/agent-plugin

ActiveOctober-plugin[Utility &amp; Helpers](/categories/utility)

pikanji/agent-plugin
====================

Detect user's browser, OS, and device from UserAgent. A wrapper plugin of jenssegers/agent.

1.0.0(8y ago)54.1k3MITPHPPHP &gt;=5.4

Since Dec 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/pikanji/oc-agent-plugin)[ Packagist](https://packagist.org/packages/pikanji/agent-plugin)[ RSS](/packages/pikanji-agent-plugin/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (2)Used By (0)

OctoberCMS Agent Plugin
=======================

[](#octobercms-agent-plugin)

[日本語版はこちら](./README_ja.md)

[OctoberCMS](http://octobercms.com/) plugin to detect user's browser, OS, and device. This is available not only from PHP but also from Twig templates.

This is a wrapper plugin of [jenssegers/agent](https://github.com/jenssegers/agent). Thanks to jenssegers, and also serbanghita created it's base [serbanghita/Mobile-Detect](https://github.com/serbanghita/Mobile-Detect).

API
---

[](#api)

Please refer [jenssegers/agent](https://github.com/jenssegers/agent) for available APIs.

Usage
-----

[](#usage)

### Installation

[](#installation)

You can install this plugin either via composer or from the backend UI.

#### With Composer

[](#with-composer)

Execute below at the root of your project.

```
composer require pikanji/agent-plugin

```

#### With OctoberCMS UI

[](#with-octobercms-ui)

- Login to OctoberCMS backend
- Go to Settings &gt; Update &amp; Plugins.
- Click "Install plugins" button.
- Search for "Agent", and select it to start installation.

### Using in Twig Templates

[](#using-in-twig-templates)

Agent object will be available after Agent component is added to pages or layouts. I recommend to add the component to your layout, so that you don't have to add every page.

Preparation is to add `[Agent]` to the configuration section of page or layout files. There is no parameter needed for Agent component.

```
description = "Default layout"

[Agent]
==

...

```

Then you can use this Agent object to call [jenssegers/agent](https://github.com/jenssegers/agent) APIs.

```
...
{% if Agent.isFireFox() %}
...

```

### Using in PHP Code

[](#using-in-php-code)

Add `use Agent;`, and call methods from `Agent` facade.

```
use Agent;
...

if (Agent::isFireFox()) {
...
```

If you don't want to use facade, you can use it like this.

```
use Jenssegers\Agent\Agent;
...

$agent = new Agent();
if ($agent->isFireFox()) {
...
```

It is just using [jenssegers/agent](https://github.com/jenssegers/agent) directly. Please refer to its documentation. You don't need to install it since it is installed as the dependency of this plugin.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

3121d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eaba70d2bf29b314c6ff30a73ebc4e89fcd710f2db99fdd4b3c318ee63b632a1?d=identicon)[pikanji](/maintainers/pikanji)

---

Top Contributors

[![pikanji](https://avatars.githubusercontent.com/u/610221?v=4)](https://github.com/pikanji "pikanji (11 commits)")

### Embed Badge

![Health badge](/badges/pikanji-agent-plugin/health.svg)

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

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[mediawiki/maps

Adds various mapping features to MediaWiki

84152.3k3](/packages/mediawiki-maps)[starcitizentools/citizen-skin

A beautiful, usable, responsive MediaWiki skin with in-depth extension support. Originally developed for the Star Citizen Wiki.

3376.6k](/packages/starcitizentools-citizen-skin)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

19251.4k3](/packages/civicrm-civicrm-drupal-8)[altis/core

Core module for Altis

19228.0k3](/packages/altis-core)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5721.7k4](/packages/pfefferle-wordpress-activitypub)

PHPackages © 2026

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