As automated bots, mobile devices and desktop browsers have exploded into a thousand different forms, it is really difficult to accurately determine just what a given user-agent represents and even more difficult to aggregate that raw information.

We do the heavy lifting for you by maintaining an always up to date database containing the latest user-agents and bot signatures. Additionally, the service collates that into easily accessible high level categories:

is_mobile

is_ios

is_android

os_family

Know instantly if a particular user is mobile, iOS, Android and what family of operating system they are using.

Once User Agent Identifier has been added a USERAGENTIDENTIFIER_API_KEY config variable will contain your specific API key granting access to the newly provisioned User Agent Identifier instance. This can be confirmed using the heroku config:get command.

After installing User Agent Identifier your application should be modified to fully integrate with the add-on.

Local setup

Environment setup

After provisioning the add-on it’s necessary to locally replicate the config vars so your development environment can operate against the service.

Use the Heroku Local command-line tool to configure, run and manage process types specified in your app’s Procfile. Heroku Local reads configuration variables from a .env file. To view all of your app’s config vars, type heroku config. Use the following command for each value that you want to add to your .env file.

$ heroku config:get USERAGENTIDENTIFIER_API_KEY -s >> .env

Credentials and other sensitive configuration values should not be committed to source-control. In Git exclude the .env file with: echo .env >> .gitignore.