---
title: Update the browser agent
source: https://docs.newrelic.com/docs/browser/new-relic-browser/installation/update-browser-agent
---

Running the latest version of our browser agent ensures you can access all browser features and enhancements. To update to the latest version, [check your version number](#checking), then follow the steps for either [updating an APM-managed installation](#upgrading-apm) or [upgrading a copy/paste installation](#upgrading-copy-paste).

## Check your version number [#checking]

To verify your browser version number, try one of the following:

-   Inspect the agent harvest payloads (`Any Browser Agent Version`):
    1.  Open the developer tools of your browser.
    2.  Open the view in the developer tools that shows network traffic.
    3.  Filter the results to only those that include `nr-data.net`.
    4.  The version will be included in the query parameters of each call to the `nr-data.net` endpoint, in the format of `?v=<version>`.
-   Inspect the source code of the agent snippet:
    -   For`v1217` or higher:
        1.  View the source code of a page which includes the JavaScript snippet.
        2.  Search the page source for `PROD` -- The version will be prepended, in the format of `<version>.PROD`.
    -   For `v1216` or lower:
        1.  View the source code of a page which includes the JavaScript snippet.
        2.  Search the page source for `js-agent.newrelic.com/nr-`.
        3.  The numbers that follow `nr-` are your current version. For example, `js-agent.newrelic.com/nr-593.min.js` indicates you are running version `593` of the browser script.
-   Inspect the newrelic global object (v1224 or higher):
    1.  Open the developer tools of your browser.
    2.  Open the console view.
    3.  In the console, enter `newrelic.initializedAgents`.
    4.  In the resulting object, expand the relevant agent object.
    5.  Inside the relevant agent object, find `runtime.version`.

## Check your installation type

There are different [agent types](https://docs.newrelic.com/docs/browser/new-relic-browser/configuration/change-browser-agent-type#agent-types). The Pro+SPA agent loader files use the format `js-agent.newrelic.com/nr-loader-<type>-<version>.min.js`.
To verify the version of the browser script loader on your page, inspect the newrelic global object (v1224 or higher):

1.  Open the developer tools of your browser.
2.  Open the console view.
3.  In the console, enter `newrelic.initializedAgents`.
4.  In the resulting object, expand the relevant agent object.
5.  Inside the relevant agent object, find `runtime.loaderType`.

## Check if your version is outdated

To verify if your browser version if outdated:

1.  See the [browser agent end of life](https://docs.newrelic.com/docs/browser/browser-monitoring/getting-started/browser-agent-eol-policy/) table.
2.  If the latest version number is higher than the number of the version you are currently running, update your browser agent.

## Check deployment method [#deploy-method]

Your browser agent may have been [deployed](https://docs.newrelic.com/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#options) in two ways: either using a manual implementation (copying and pasting the snippet) or automatically instrumented using an APM agent. To check which deployment method was used, run this command in the JavaScript console:

```
> newrelic.info.sa
```

If the command returns `1`, then your browser agent used the [copy/paste method](#upgrading-copy-paste).

## Update your APM-managed installation [#upgrading-apm]

To update your [APM-managed browser installation](https://docs.newrelic.com/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#options), restart your APM agent. Your app will automatically update to the latest JavaScript snippet.

To ensure the new script registers, you may need to clear your cache. For more information, follow the troubleshooting procedures to [manually check and clear the cache](https://docs.newrelic.com/docs/browser/new-relic-browser/troubleshooting/troubleshooting-browser-monitoring-installation#manual_check_cache).

## Update your copy/paste installation [#upgrading-copy-paste]

Use any of the following options to access the browser JavaScript snippet needed to update a copy/paste installation. After accessing the snippet, be sure to replace **all** of your existing snippet with the new version.

-   If you have a standalone installation with a few applications, you can retrieve the snippet from the UI, and then replace it with the new version.
-   If you have many applications, you can use the REST API or the loader endpoint to automate the update process.

> #### ⚠️ CAUTION
>
> Do not simply change the version number in the existing snippet. This can result in incomplete data collection. For best results after you use any of the following options, always update the agent.

**Retrieve the snippet from the UI**

Download the latest version of the snippet: Go to **[one.newrelic.com > All capabilities](https://one.newrelic.com/all-capabilities) > Browser > (select an app) > Application settings**.

This option is only available for standalone installations.

**Extract the snippet with the REST API**

To update the snippet using the New Relic REST API, follow the process for [viewing a specific browser app](https://docs.newrelic.com/docs/apm/apis/browser-examples-v2/adding-or-listing-browser-apps-api-v2#specific-browser-app). The `loader_script` attribute in your response will include the latest JavaScript snippet.

This may be a good solution if you have many applications to manage, or if your browser app is linked to an APM app.

**Update using the loader endpoint**

To update the snippet from the New Relic loader endpoint, you can choose which type of [browser agent](https://docs.newrelic.com/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#agent-types) you want:

-   [Pro+SPA endpoint](https://js-agent.newrelic.com/nr-loader-spa-current.min.js)
-   [Pro endpoint](https://js-agent.newrelic.com/nr-loader-full-current.min.js)
-   [Lite endpoint](https://js-agent.newrelic.com/nr-loader-rum-current.min.js)

    These endpoints always point to the latest version of the agent.

    We recommend using the Pro+SPA agent. [Read more about these agent types.](https://docs.newrelic.com/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#agent-types)

    These loader endpoints are generic and do not include your specific configuration data. To add your configuration data to the loaders:

1.  Find your browser application ID and license key: Follow standard procedures to use the [New Relic UI](https://docs.newrelic.com/docs/browser/new-relic-browser/installation-configuration/copying-your-browser-monitoring-license-key-app-id) or the [REST API](https://docs.newrelic.com/docs/apm/apis/browser-examples-v2/adding-or-listing-browser-apps-api-v2#specific-browser-app).
2.  Set your browser application ID and license key immediately after the snippet.

    ```js
    NREUM.info = { applicationID: "YOUR-APPLICATION-ID",
                   licenseKey:    "YOUR-BROWSER-LICENSE-KEY" };
    ```
