Gatsby Plugin Newrelic banner
newrelic newrelic

Gatsby Plugin Newrelic

Development community

Description

A Gatsby plugin for instrumenting your site with New Relic's Browser Agent

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

[![Community Project header](https://github.com/newrelic/open-source-office/raw/master/examples/categories/images/Community_Project.png)](https://github.com/newrelic/open-source-office/blob/master/examples/categories/index.md#community-project)

New Relic Gatsby Plugin

[![Known Vulnerabilities][3]][4] [![npm status badge][1]][2]

The New Relic Gatsby Plugin provides a simple to use configuration option for instrumenting your Gatsby site with [New Relic's Browser Agent](https://newrelic.com/products/browser-monitoring).

Installation

  1. If you don't already have a New Relic account, [sign-up for our free forever tier - no credit-card required!](https://trynewrelic.com/gatsby)

  2. Go to [https://one.newrelic.com](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: "",
      trustKey: "",
      agentID: "",
      licenseKey: "",
      applicationID: "",
    };
    NREUM.info = {
      beacon: "bam.nr-data.net",
      errorBeacon: "bam.nr-data.net",
      licenseKey: "",
      applicationID: "",
      sa: 1,
    };

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