npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gatsby-plugin-newrelic

v2.6.0

Published

Gatsby plugin for implementing the New Relic Browser agent

Downloads

31,847

Readme

Community Project header

New Relic Gatsby Plugin

Known Vulnerabilities npm status badge

The New Relic Gatsby Plugin provides a simple to use configuration option for instrumenting your Gatsby site with New Relic's Browser Agent.

Installation

  1. If you don't already have a New Relic account, sign-up for our free forever tier - no credit-card required!

  2. Go to https://one.newrelic.com

  3. Click on "Add more data" to add your website

  4. In the "Browser metrics" section, select "New Relic Browser"

  5. Select "Copy/Paste Javascript code" and copy the code

  6. Follow the steps to configure your instrumentation

  7. Enter your app name

  8. Click "Enable"

  9. Paste the JS snippet provided into a text editor

  10. Open your gatsby-config.js file for your project

  11. You'll need to copy information from the JS snippet, which looks like this:

    // use this line for the `settings` object
    window.NREUM || (NREUM = {});
    NREUM.init = {
      distributed_tracing: { enabled: true },
      privacy: { cookies_enabled: true },
      ajax: { deny_list: ["bam-cell.nr-data.net"] },
    };
    
    // use these lines for the `config` object
    NREUM.loader_config = {
      accountID: "<your account id>",
      trustKey: "<some integer>",
      agentID: "<some integer>",
      licenseKey: "<your license key>",
      applicationID: "<some integer>",
    };
    NREUM.info = {
      beacon: "bam.nr-data.net",
      errorBeacon: "bam.nr-data.net",
      licenseKey: "<your license key>",
      applicationID: "<some integer>",
      sa: 1,
    };

    and turn it into a gatsby-config object, adding it to gatsby-config.js as a plugin

    {
     resolve: 'gatsby-plugin-newrelic',
     options: {
       config: {
           instrumentationType: 'proAndSPA',
           accountId: '<some integer>',
           trustKey: '<some integer>',
           agentID: '<some integer>',
           licenseKey: '<the license key>',
           applicationID: '<some integer>',
           beacon: 'bam.nr-data.net',
           errorBeacon: 'bam.nr-data.net'
           settings: {
             distributed_tracing: { enabled: true },
             privacy: { cookies_enabled: true },
             ajax: { deny_list: ["bam-cell.nr-data.net"] },
           }
       }
     }
    }

    If you have a need for multiple environments, you can configure this like:

    {
      resolve: 'gatsby-plugin-newrelic',
      options: {
        config: {
            instrumentationType: 'proAndSPA',
            accountId: '<some integer>',
            trustKey: '<some integer>',
            agentID: '<some integer>',
            licenseKey: '<the license key>',
            applicationID: process.env.YOUR_ENVIRONMENT_KEY === "production" ? '<some integer>' : '<some other integer>',
            beacon: 'bam.nr-data.net',
            errorBeacon: 'bam.nr-data.net'
        }
      }
    }

    If you have selected custom Session Replay values for block_selector or mask_text_selector, replace the surrounding single quotes(') with back ticks (`)

    {
        settings: {
         session_replay: {
           enabled: true,
         // block_selector: '[autocomplete="cc-number"], [autocomplete="cc-name"]',
           block_selector: `[autocomplete="cc-number"], [autocomplete="cc-name"]`,
         // mask_text_selector: '.className1, #elementID'`,
           mask_text_selector: `.className1, #elementID`,
        }
      }
    }

Getting Started

Navigate to https://one.newrelic.com, select the Entity Explorer and then select your browser application to monitor metrics of your site.

Support

New Relic hosts and moderates an online forum where customers can interact with New Relic employees as well as other customers to get help and share best practices. Like all official New Relic open source projects, there's a related Community topic in the New Relic Explorers Hub. You can find this project's topic/threads here:

Add the url for the support thread here

Contributing

Full details about how to contribute to Contributions to improve [Project Name] are encouraged! Keep in mind when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project. To execute our corporate CLA, which is required if your contribution is on behalf of a company, or if you have any questions, please drop us an email at [email protected].

License

gatsby-plugin-newrelic is licensed under the Apache 2.0 License. gatsby-plugin-newrelic also uses source code from third party libraries. Full details on which libraries are used and the terms under which they are licensed can be found in the third party notices document.