{"id":19773494,"url":"https://github.com/dmitryfillo/newrelic-reduced","last_synced_at":"2025-06-12T07:04:20.305Z","repository":{"id":47241596,"uuid":"139732970","full_name":"DmitryFillo/newrelic-reduced","owner":"DmitryFillo","description":"New Relic plugin that can be disabled for some users.  Cut your costs!","archived":false,"fork":false,"pushed_at":"2021-09-07T09:01:37.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-11T01:12:38.371Z","etag":null,"topics":["newrelic"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DmitryFillo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-04T14:30:53.000Z","updated_at":"2021-09-07T09:01:40.000Z","dependencies_parsed_at":"2022-08-19T12:00:17.779Z","dependency_job_id":null,"html_url":"https://github.com/DmitryFillo/newrelic-reduced","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DmitryFillo%2Fnewrelic-reduced","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DmitryFillo%2Fnewrelic-reduced/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DmitryFillo%2Fnewrelic-reduced/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DmitryFillo%2Fnewrelic-reduced/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DmitryFillo","download_url":"https://codeload.github.com/DmitryFillo/newrelic-reduced/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241104238,"owners_count":19910394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["newrelic"],"created_at":"2024-11-12T05:09:53.179Z","updated_at":"2025-02-28T05:17:37.970Z","avatar_url":"https://github.com/DmitryFillo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# newrelic-reduced\nNew Relic plugin that can be disabled for some users.\n\n![New Relic](https://newrelic.com/assets/newrelic/source/NewRelic-logo-bug.svg)\n\n## Motivation\nNeed to reduce costs by disabling NR browser monitoring for some users? This plugin is for you.\n\n## How to use\nJust do 2 steps:\n  * Define variables:\n      * `window.NRReducedID` is your NR ID. Required.\n      * `window.NRReducedKey` is your NR Key. Required.\n      * `window.NRReducedFactor` is percent integer value describing probability of NR enabling. E.g. value 50 means NR will be enabled for ~50% of users. 0 \u003c `factor` \u003c 100. Optional, default is 100.\n      * `window.NRReducedLogging` is logging boolean setting. If `true` you'll see `NR enabled` message in the console when NR script is enabled. Optional, default is `false`.\n      * `window.NRReducedOpts` is options for original NR script. Check section *Additional options* below. Optional, defaults see in the source code.\n  * Import plugin:\n      * Use CDN: `\u003cscript src=\"https://cdn.jsdelivr.net/npm/newrelic-reduced@x.x.x/lib/index.js\"\u003e\u003c/script\u003e` where `x.x.x` is [version](https://github.com/DmitryFillo/newrelic-reduced/releases).\n      * Use imports: `import 'newrelic-reduced'` or `require('newrelic-reduced')`.\n      * Use any other way to include it into HTML from `lib/index.js`.\n\n**NOTES:**\n  * You should define variables before import!\n  * You should define NR script before any other scripts, better to place it right after `\u003chead\u003e`.\n\n### Variables substitutions\nInstead of defining global variables prefixied with `window.NRReduced` you can replace special placeholders in the source code:\n\n  * `#{NRID}` is your NR ID. Required.\n  * `#{NRKey}` is your NR Key. Required.\n  * `#{NRFactor}` is percent integer value describing probability of NR enabling. E.g. value 50 means NR will be enabled for ~50% of users. 0 \u003c `factor` \u003c 100. Can be string value, e.g. \"50\".\n  * `#{NRIsLoggingEnabled}` is logging boolean setting. If `true` you'll see `NR enabled` message in the console when NR script is enabled. Can be string value, e.g. \"true\" or \"false\".\n  * `#{NROpts}` is options for original NR script. Can be string value, e.g. \"{ ... }\". Check section *Additional options* below.\n\n## Additional options\nIt's some variables from native NR script, check the source code for more info.\n```javascript\nwindow.NRReducedOpts = {\n    beacon: 'api.example.com',\n    jsAgentPath: 'example.com/nr.js',\n    errorBeacon: 'apie.example.com',\n    sa: 2\n};\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitryfillo%2Fnewrelic-reduced","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmitryfillo%2Fnewrelic-reduced","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitryfillo%2Fnewrelic-reduced/lists"}