Registry / monitoring / new-relic-agent-react

new-relic-agent-react

JSON →
library2.0.1jsnpmunverified

React component wrapper for New Relic Browser agent instrumentation. Latest version 2.0.1 (2017). No recent releases; appears unmaintained. Injects the New Relic JavaScript snippet for Pro+SPA features. Works with React >=0.14.8 <15.4.2, which is outdated. Alternative: use @newrelic/browser-agent directly.

npm install new-relic-agent-react
INSTALL
IMPORT
SIG · NEW-RELIC-AGENT-RE
N
new-relic-agent-react
monitoringjavascriptv2.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NewRelic
import NewRelic from 'new-relic-agent-react'
const NewRelic = require('new-relic-agent-react')
Default ESM import; CommonJS require works but discouraged.
NewRelic
import NewRelic from 'new-relic-agent-react'
No named exports; only default component.
NewRelic
import NewRelic from 'new-relic-agent-react'
Component expects licenseKey and applicationID props as strings.

Shows basic usage: import NewRelic component and render inside <head> with licenseKey and applicationID.

import React from 'react'; import NewRelic from 'new-relic-agent-react'; const App = () => ( <html> <head> <NewRelic licenseKey="xxxxxxxx" applicationID="yyyyyyyy" /> <title>My App</title> </head> <body> <div id="root">Hello world</div> </body> </html> ); export default App;
Debug
Known issues
deprecatedPackage is outdated; last updated in 2017. No support for modern React (>=16) or current New Relic agent.
fix
Use @newrelic/browser-agent or newer community alternatives.
affects: >=0.0.0
breakingPeer dependency react >=0.14.8 < ^15.4.2 restricts usage to React 15.x only.
fix
React 16+ not supported; consider forking or upgrading to native New Relic script.
affects: >=2.0.0
gotchaComponent must be placed inside <head>, not <body>, or New Relic may not instrument correctly.
fix
Always render <NewRelic> inside the <head> element.
affects: >=0.0.0
gotchalicenseKey and applicationID must be strings; numeric IDs cause runtime errors.
fix
Pass as strings: licenseKey="abc123" not licenseKey={123}.
affects: >=0.0.0
Errors
Common errors & fixes
Uncaught Error: Minified React error #321; visit https://reactjs.org/docs/error-decoder.html?invariant=321 for the full message.
Using React version incompatible with package's peer dependency.
fix
Use React 15.x (>=0.14.8 <15.4.2) or remove this package and use New Relic script directly.
TypeError: Cannot read property 'licenseKey' of undefined
Component rendered without props or with undefined values.
fix
Ensure <NewRelic licenseKey="yourKey" applicationID="yourAppID" /> has both props as strings.
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
28 hits · last 30 days
node
22
OpenAI (training)
1
Resources
new-relic-agent-react — npm install new-relic-agent-react · libregistry