Install the Agent

Install the Agent

You’ll need to install our JavaScript agent on your website to collect performance data. The agent is only 3.4 kb and async ready so it will have no significant impact on your page.

Install from Our CDN

The easiest way to get started is by including the script from our hosted CDN. We use the same CDN service that hosts jQuery, so it should be reliable and fast. However, you may also feel free to pull the agent script and host/bundle it yourself if you’re extra paranoid (we don’t blame you).

<script async src=""

The agent will automatically install when you provide the data-rm-token attribute. If you prefer to control when the agent initializes, you can install the agent manually.

<script src=""></script>
  // Once you are *sure* the Request Metrics agent script has been loaded
  window.RM && RM.install({

Note: Manually calling install requires that you know that the agent has loaded, so you won’t be able to load the script asynchronously.

Install from NPM

If you prefer to control your own destiny, you can include our npm package in your JavaScript bundle. Install it with:

npm i @request-metrics/browser-agent

Then reference the module and install it when initializing your application.

import { RM } from '@request-metrics/browser-agent';

RM.install({ token: 'YOUR_APPLICATION_TOKEN' })