Skip to content

Commit 6c479c1

Browse files
authored
Merge pull request #21431 from newrelic/nr-448474-ba-npm-update
feat: Added new npm guided flow
2 parents f7671be + 491cfab commit 6c479c1

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

src/content/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent.mdx

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ There are four ways to install the browser agent. Depending on your specific nee
3232

3333
<Tabs>
3434
<TabsBar>
35+
<TabsBarItem id="npm">
36+
Install with npm
37+
</TabsBarItem>
38+
3539
<TabsBarItem id="1">
3640
Get JavaScript via UI
3741
</TabsBarItem>
@@ -43,13 +47,25 @@ There are four ways to install the browser agent. Depending on your specific nee
4347
<TabsBarItem id="3">
4448
Create JavaScript via NerdGraph
4549
</TabsBarItem>
46-
47-
<TabsBarItem id="4">
48-
Install via NerdGraph and npm
49-
</TabsBarItem>
5050
</TabsBar>
5151

5252
<TabsPages>
53+
<TabsPageItem id="npm">
54+
Go to <DNT>**[one.newrelic.com](https://one.newrelic.com) > Integrations & Agents > Browser and mobile > Browser monitoring**</DNT> and follow the instructions to generate the browser npm snippet in the UI.
55+
56+
<ButtonGroup>
57+
<ButtonLink
58+
role="button"
59+
to="https://onenr.io/0MRNpYqNqQn"
60+
variant="primary"
61+
>
62+
Get your browser snippet
63+
</ButtonLink>
64+
</ButtonGroup>
65+
66+
Once you have the snippet, paste it at the first line of your source file, before any other code. This ensures that the browser agent is loaded before any other scripts execute.
67+
68+
</TabsPageItem>
5369
<TabsPageItem id="1">
5470
Go to <DNT>**[one.newrelic.com](https://one.newrelic.com) > Integrations & Agents > Browser and mobile > Browser monitoring**</DNT> and follow the instructions to generate the browser JavaScript snippet in the UI.
5571

@@ -67,8 +83,6 @@ There are four ways to install the browser agent. Depending on your specific nee
6783

6884
For more detailed information about the placing the snippet, see [JavaScript placement requirements](/docs/browser/new-relic-browser/page-load-timing-resources/instrumentation-browser-monitoring#javascript-placement).
6985

70-
(If you'd like to install the browser agent via npm, see our [`@newrelic/browser-agent` package](https://www.npmjs.com/package/@newrelic/browser-agent).)
71-
7286
<Collapser
7387
id="browser_delay"
7488
title="Delay browser monitoring"
@@ -104,7 +118,7 @@ There are four ways to install the browser agent. Depending on your specific nee
104118
<TabsPageItem id="2">
105119
With an APM agent, you can deploy browser monitoring without manually adding the snippet to your code. When you restart the agent, it automatically uses the latest version of the browser agent.
106120

107-
If you're using an APM (application performance monitoring) agent to monitor the backend of your browser app and you've got a non-[SPA](/docs/browser/single-page-app-monitoring/get-started/introduction-single-page-app-monitoring) app, then we recommend using this method.
121+
If you're using an APM agent to monitor the backend of your browser app and you've got a non-[SPA](/docs/browser/single-page-app-monitoring/get-started/introduction-single-page-app-monitoring) app, then we recommend using this method.
108122

109123
There are specific steps for each APM agent:
110124

@@ -125,14 +139,16 @@ There are four ways to install the browser agent. Depending on your specific nee
125139
Once you have the snippet, add it to the `<head>` tag of your app.
126140
</TabsPageItem>
127141

128-
<TabsPageItem id="4">
129-
If you want to automate browser monitoring deployment across multiple web apps, you can use NerdGraph and our browser agent npm package to configure and deploy the agent as part of your application build process.
130-
131-
For more on this, see [instrument multiple apps with npm and NerdGraph](/docs/apis/nerdgraph/examples/combining-npm-nerdgraph/).
132-
</TabsPageItem>
133142
</TabsPages>
134143
</Tabs>
135144

145+
<Callout variant="important">
146+
147+
If you want to automate browser monitoring deployment across multiple web apps, you can use NerdGraph and our browser agent npm package to configure and deploy the agent as part of your application build process.
148+
149+
For more on this, refer to [instrument multiple apps with npm and NerdGraph](/docs/apis/nerdgraph/examples/combining-npm-nerdgraph/).
150+
</Callout>
151+
136152
## What's next? [#whats-next]
137153

138154
When you've installed the browser agent, wait a few minutes and look for the data in [our browser monitoring UI](https://one.newrelic.com/nr1-core?filters=%28domain%3D%27BROWSER%27%20AND%20type%3D%27APPLICATION%27%29&state=1f7bae2d-dd3a-0027-3079-b60bcd19ded9&_gl=1*15f78ub*_ga*MTE0MTA2MTA5MS4xNzE4OTI0MDkw*_ga_R5EF3MCG7B*MTcyMTMxMzk2MC41Ny4xLjE3MjEzMTg2MzcuNDcuMS4xMDYwNTI3Njcw).

0 commit comments

Comments
 (0)