Home

Awesome

browserslist-new-relic

A CLI tool that generates a custom usage data file for Browserslist from your New Relic Browser data.

npm package total downloads node version license open issues Tests

How to use

Before you can run the command you'll need to prepare the following information:

Check out the Options section for specific details.

In the root of your project run

npx browserslist-new-relic --appId <application id> --accountId <account id> --apiKey <api key>

Now that you've successfully run the command you'll have generated browserslist-stats.json in your project's root directory. This file contains your custom usage data from New Relic. In your browserslist config you can now do things like:

> 0.5% in my stats

or

> 0.5% in my stats, > 1% in US

Options

--version    Show version number                                     [boolean]
--accountId  New Relic account ID                          [string] [required]
--apiKey     New Relic Insights query API key              [string] [required]
--appId      New Relic Browser application ID              [string] [required]
--debug      Turn on debugging output               [boolean] [default: false]
--duration   Days of browser usage to fetch              [number] [default: 7]
--help       Show help                                               [boolean]

--accountId

The New Relic account ID that you want to retrieve data for. For information on where to find your account ID, check the New Relic docs.

--apiKey

A New Relic Insights query API key. For information on creating a query API key, check the New Relic docs.

--appId

The New Relic Browser application ID that you want to retrieve data for. For more information on where to find your application ID, check the New Relic docs.

--debug

Turns on output used for debugging issues.

--duration

The number of days of browser usage data to fetch.

--help

Outputs information about the options.

--version

Outputs some helpful information about the command.

Example Usage

With all required options

browserslist-new-relic --appId 48927374561 --accountId 45182429 --apiKey Hus4-hsSDFjls802dsSfjI82-PZhsqotm2H86

With all required options as environment variables

browserslist-new-relic

With duration of 2 days

browserslist-new-relic --duration 2 --appId 48927374561 --accountId 45182429 --apiKey Hus4-hsSDFjls802dsSfjI82-PZhsqotm2H86

With debugging output

browserslist-new-relic --debug --appId 48927374561 --accountId 45182429 --apiKey Hus4-hsSDFjls802dsSfjI82-PZhsqotm2H86

Issues

Please report any issues on GitHub.