PHPackages                             setono/bot-detection-bundle - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. setono/bot-detection-bundle

ActiveSymfony-bundle[Testing &amp; Quality](/categories/testing)

setono/bot-detection-bundle
===========================

A Symfony bundle that allows you to test if a user agent is a bot

v1.13.0(1y ago)8111.2k↓26.3%3[1 PRs](https://github.com/Setono/BotDetectionBundle/pulls)9MITPHPPHP &gt;=7.4CI passing

Since Nov 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Setono/BotDetectionBundle)[ Packagist](https://packagist.org/packages/setono/bot-detection-bundle)[ RSS](/packages/setono-bot-detection-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (17)Versions (18)Used By (9)

Symfony Bot Detection Bundle
============================

[](#symfony-bot-detection-bundle)

[![Latest Version](https://camo.githubusercontent.com/3b8787fec653400d5186e05c4e1e73005d56c8c00036d81290cf3479d8790d54/68747470733a2f2f706f7365722e707567782e6f72672f7365746f6e6f2f626f742d646574656374696f6e2d62756e646c652f762f737461626c65)](https://packagist.org/packages/setono/bot-detection-bundle)[![Software License](https://camo.githubusercontent.com/514cc46ee98f557efa087d0280d8dd0e99108e68947b3d421c8ed0780b35ea15/68747470733a2f2f706f7365722e707567782e6f72672f7365746f6e6f2f626f742d646574656374696f6e2d62756e646c652f6c6963656e7365)](LICENSE)[![Build Status](https://github.com/Setono/BotDetectionBundle/workflows/build/badge.svg)](https://github.com/Setono/BotDetectionBundle/actions)[![Code Coverage](https://camo.githubusercontent.com/3bf40a366005bbbee4f931f82c022a811c55cd9bc6e9b6619165f0726c396320/68747470733a2f2f636f6465636f762e696f2f67682f5365746f6e6f2f426f74446574656374696f6e42756e646c652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/Setono/BotDetectionBundle)[![Mutation testing](https://camo.githubusercontent.com/2d386a3f79c22e50fda89c037c4cb9743f9ba746c7961575317d7067d6951122/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d2532465365746f6e6f253246426f74446574656374696f6e42756e646c652532466d6173746572)](https://dashboard.stryker-mutator.io/reports/github.com/Setono/BotDetectionBundle/master)

Detect if the user agent is a bot and act upon it. Under the hood this bundle uses the [matomo-org/device-detector](https://github.com/matomo-org/device-detector), but instead of just using that library this library has a very small subset of user agents that it checks first (i.e. major search engines). This makes it much faster in detecting those very common bots and hence speeds up your request cycle.

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

[](#installation)

```
composer require setono/bot-detection-bundle
```

This installs and enables the plugin automatically if you're using Symfony Flex. If not, add the bundle manually to `bundles.php`.

Usage
-----

[](#usage)

You can use the bot detector in your services:

```
