PHPackages                             s1syphos/kirby-device - 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. s1syphos/kirby-device

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

s1syphos/kirby-device
=====================

Comprehensive user agent &amp; device detection for Kirby

0.2.0(8y ago)1213MITPHP

Since Mar 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/S1SYPHOS/kirby-device)[ Packagist](https://packagist.org/packages/s1syphos/kirby-device)[ RSS](/packages/s1syphos-kirby-device/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Kirby Device
============

[](#kirby-device)

[![Release](https://camo.githubusercontent.com/03246fad9e140b652efb803f84353139f03d5a5900e4c56714f25a897248f85a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f5331535950484f532f6b697262792d6465766963652e7376673f636f6c6f723d253232627269676874677265656e253232)](https://github.com/S1SYPHOS/kirby-device/releases) [![License](https://camo.githubusercontent.com/191046190096c84f60ca5e9a85cf791f85230f81be4854cd8dd3e37be40da429/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f5331535950484f532f6b697262792d6465766963652e737667)](https://github.com/S1SYPHOS/kirby-device/blob/master/LICENSE) [![Issues](https://camo.githubusercontent.com/c38571519fdcd798570e578a0c67d749cf0e11133a4c8acfebf3d2cd79592771/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f5331535950484f532f6b697262792d6465766963652e737667)](https://github.com/S1SYPHOS/kirby-device/issues)

This plugin detects devices (such as desktop, tablet, mobile, tv, cars, console, ..), clients (browsers, feed readers, media players, PIMs, ..) as well as operating systems, brands and models.

**Table of contents**

- [1. Main features](#main-features)
- [2. Getting started](#getting-started)
- [3. Configuration](#configuration)
- [4. Available methods](#available-methods)
- [5. Examples](#examples)
- [6. Credits / License](#credits--license)

Main features
-------------

[](#main-features)

`kirby-device` provides the `device()` function for parsing information from the target's user agent (UA) - the [black-magic voodoo science of regular expressions](https://blogs.perficient.com/perficientdigital/2017/12/04/the-magic-of-regex-an-intro-to-regular-expressions) then enables you to identify

- [operating systems](https://github.com/matomo-org/device-detector#list-of-detected-operating-systems)
- [browsers](https://github.com/matomo-org/device-detector#list-of-detected-browsers)
- [browser engines](https://github.com/matomo-org/device-detector#list-of-detected-browser-engines)
- [libraries](https://github.com/matomo-org/device-detector#list-of-detected-libraries) (eg cURL, Perl, Wget, ..)
- [media players](https://github.com/matomo-org/device-detector#list-of-detected-media-players)
- [personal information managers](https://github.com/matomo-org/device-detector#list-of-detected-pims-personal-information-manager) (PIMs)
- [feed readers](https://github.com/matomo-org/device-detector#list-of-detected-feed-readers)
- [brands &amp; devices](https://github.com/matomo-org/device-detector#list-of-brands-with-detected-devices)
- .. and of course: [bots](https://github.com/matomo-org/device-detector#list-of-detected-bots)

Getting started
---------------

[](#getting-started)

Use one of the following methods to install &amp; use `kirby-device`:

### Git submodule

[](#git-submodule)

If you know your way around Git, you can download this plugin as a [submodule](https://github.com/blog/2104-working-with-submodules):

```
git submodule add https://github.com/S1SYPHOS/kirby-device.git site/plugins/kirby-device

```

### Composer

[](#composer)

```
composer require S1SYPHOS/kirby-device:dev-composer

```

### Clone or download

[](#clone-or-download)

1. [Clone](https://github.com/S1SYPHOS/kirby-device.git) or [download](https://github.com/S1SYPHOS/kirby-device/archive/master.zip) this repository.
2. Unzip / Move the folder to `site/plugins`.

### Activate the plugin

[](#activate-the-plugin)

Activate the plugin with the following line in your `config.php`:

```
c::set('plugin.kirby-device', true);

```

Configuration
-------------

[](#configuration)

Change `kirby-device` options to suit your needs:

OptionTypeDefaultDescription`plugin.kirby-device.truncate-version`String`minor`Defines the browser build or version format according to the [semantic versioning](https://semver.org/) specification (allowed values are `major`, `minor`, `patch` as well as `build` &amp; `none`).`plugin.kirby-device.enable-filecache`Boolean`true`Optionally enables / disables filecache.Available methods
-----------------

[](#available-methods)

These methods are available to meet your device detection requirements:

```
// Configuration Methods
setCache()
setYamlParser()
discardBotInformation()
skipBotDetection()

// General Device Type Methods
isBot()
isMobile()
isDesktop()
isTouchEnabled() // win8 tablets only

// General Client Type Methods
getBot() // array
getClient() // array | optionally string, eg getClient('version'))
getOs() // array | optionally string, eg getOs('version')
getDevice()
getDeviceName()
getBrand()
getBrandName()
getModel()
getUserAgent()

// Specific Device Type Methods
isSmartphone()
isFeaturePhone()
isTablet()
isPhablet()
isConsole()
isPortableMediaPlayer()
isCarBrowser()
isTV()
isSmartDisplay()
isCamera()

// Specific Client Type Methods
isBrowser()
isFeedReader()
isMobileApp()
isPIM()
isLibrary()
isMediaPlayer()
```

Unless stated, all `getSomething()` methods return strings and all `isSomething()` methods return booleans.

Examples
--------

[](#examples)

### Check for mobile environment

[](#check-for-mobile-environment)

```
if (device()->isMobile()) {
  // Your code here.
}
```

### Check for tablet device

[](#check-for-tablet-device)

```
if (device()->isTablet()) {
  // Your code here.
}
```

### Only show code on desktop or tablet device

[](#only-show-code-on-desktop-or-tablet-device)

```
if(device()->isDesktop() || device()->isTablet()) {
    // Your desktop & tablet code here.
}
```

### .. and much more!

[](#-and-much-more)

```
// Get mobile device information
$brand = device()->getBrandName(); // eg 'Apple'
$model = device()->getModel(); // eg 'iPhone'
```

Feel free to write your own methods:

```
// Custom function detecting Chrome browser
function isChrome() {
  return device()->getClient('name') == 'Chrome' ? true : false;
}
```

For more information, see the [project's repo](https://github.com/serbanghita/Mobile-Detect) or check out its [demo page](http://devicedetector.net/index.php).

Credits / License
-----------------

[](#credits--license)

`kirby-device` is based on Matomo's [DeviceDetector](https://github.com/matomo-org/device-detector) and was inspired by [Sonja Broda](https://github.com/texnixe)'s Kirby plugin [kirby-mobile-detect](https://github.com/texnixe/kirby-mobile-detect) (an implementation of Şerban Ghiţă's [Mobile-Detect](https://github.com/serbanghita/Mobile-Detect)). It is licensed under the [MIT License](LICENSE), but **using Kirby in production** requires you to [buy a license](https://getkirby.com/buy). Are you ready for the [next step](https://getkirby.com/next)?

Special Thanks
--------------

[](#special-thanks)

I'd like to thank everybody that's making great software - you people are awesome. Also I'm always thankful for feedback and bug reports :)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Every ~4 days

Total

2

Last Release

3026d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5933072731cd628e1ef2bdc59bc81da16dac859145a3be2dc5c83aab9095179b?d=identicon)[S1SYPHOS](/maintainers/S1SYPHOS)

---

Top Contributors

[![S1SYPHOS](https://avatars.githubusercontent.com/u/12161504?v=4)](https://github.com/S1SYPHOS "S1SYPHOS (16 commits)")

---

Tags

bot-detectionbrowser-detectiondetectiondevice-detectiondevice-detectorkirbykirby-cmskirby-pluginmatomomobile-detectiontablet-detectionuser-agent

### Embed Badge

![Health badge](/badges/s1syphos-kirby-device/health.svg)

```
[![Health](https://phpackages.com/badges/s1syphos-kirby-device/health.svg)](https://phpackages.com/packages/s1syphos-kirby-device)
```

###  Alternatives

[akeneo/pim-community-dev

Akeneo PIM, the future of catalog management is open!

1.0k620.8k86](/packages/akeneo-pim-community-dev)[metamodels/core

MetaModels core

9956.1k68](/packages/metamodels-core)[hanson/foundation-sdk

220122.4k116](/packages/hanson-foundation-sdk)[oxid-esales/oxideshop-metapackage-ce

This is OXID eShop compilation metapackage.

13494.0k21](/packages/oxid-esales-oxideshop-metapackage-ce)[pdir/social-feed-bundle

Social feed extension for Contao CMS

1415.5k](/packages/pdir-social-feed-bundle)[contao-community-alliance/dc-general

Universal data container for Contao

1579.5k90](/packages/contao-community-alliance-dc-general)

PHPackages © 2026

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