A CLI tool that generates a custom usage data file for Browserslist from your New Relic Browser data.
Before you can run the command you'll need to prepare the following information:
- New Relic Browser application ID
- New Relic account ID
- New Relic Insights query API key
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
--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]
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.
- Default: None
- Environment Variable:
BROWSERSLIST_NEW_RELIC_ACCOUNT_ID
- Required: Yes
A New Relic Insights query API key. For information on creating a query API key, check the New Relic docs.
- Default: None
- Environment Variable:
BROWSERSLIST_NEW_RELIC_API_KEY
- Required: Yes
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.
- Default: None
- Environment Variable:
BROWSERSLIST_NEW_RELIC_APP_ID
- Required: Yes
Turns on output used for debugging issues.
- Default:
false
- Environment Variable: None
- Required: No
The number of days of browser usage data to fetch.
- Default:
7
- Environment Variable: None
- Required: No
Outputs information about the options.
- Default: None
- Environment Variable: None
- Required: No
Outputs some helpful information about the command.
- Default: None
- Environment Variable: None
- Required: No
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
Please report any issues on GitHub.