Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@creditas/new-relic-react-lib

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@creditas/new-relic-react-lib

React component for New Relic script

  • 1.0.10
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

@creditas/new-relic-react-lib

TODO: description

Usage

New Relic - React integration plugin

The package is based on new-relic-react package by reggi and later forked by wanderio. This variation includes a recent version of New Relic Browser plugin to inject JavaScript snippet to instrument your app's webpages. The javascript provided in this library include all Pro and SPA features of new relic's browser agent.

It includes also rollup.js to bundle source code as React component.

Getting Started

new-relic-react-lib can be installed as any other npm package.

Installation

npm install --save new-relic-react-lib

Application Structure

.
├── src                     # Source files
│   ├── index.js            # New Relic - React component source code
├── package.json            # Package information with list of dependencies
├── LICENSE.md
└── README.md

Usage

Just import NewRelic into your component

Retrieve this information from your New Relic account

  • licenseKey: New Relic account license key
  • applicationID: Current New Relic application ID

<NewRelic licenseKey="{licenseKey}" applicationID="{applicationID}" onlyConfig /> where licenseKey and applicationID are real IDs you retrieved and onlyConfig defines if it will return a component or only the script of New Relic.

Following code is a super simple example of integration

import React from 'react'
import { NewRelic } from 'new-relic-agent-react'

const Html = () => {
  return (
    <html>
      <head>
        <meta charSet="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <meta httpEquiv="x-ua-compatible" content="ie=edge" />
        <NewRelic licenseKey="xxxx" applicationID="yyyy" />
        <title>Web App</title>
      </head>
      <body>
        <div id="app">
          {children}
        </div>
      </body>
    </html>
  )
}

export default Html

or

import React from 'react'
import { NewRelic } from 'new-relic-agent-react'

const Html = () => {
  return (
    <html>
      <head>
        <meta charSet="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <meta httpEquiv="x-ua-compatible" content="ie=edge" />
        <script type="text/javascript">
          <NewRelic licenseKey="xxxx" applicationID="yyyy" onlyConfig />
        </script>
        <title>Web App</title>
      </head>
      <body>
        <div id="app">
          {children}
        </div>
      </body>
    </html>
  )
}

export default Html

Contributing

All contribution must be done opening trough pull request

Deploy

Deploy is automaticaly made by CircleCI when you set a tag in your git project. First hand, change the version in the package.json. To ensure consistency check JFrog to see which is the latest version released, then, add a tag to git

git checkout master
git tag vX.Y.Z
git checkout vX.Y.Z
git push origin vX.Y.Z

License

Copyright (c) 2019 Creditas

MIT - http://opensource.org/licenses/mit-license.php


based on https://github.com/wanderio/new-relic-react

FAQs

Package last updated on 15 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc