> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sazabi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# New Relic Browser

> Point the New Relic browser agent at Sazabi to ship the browser logs and JavaScript errors it already captures.

[All New Relic integration capabilities](https://docs.sazabi.com/catalogs/integrations/new-relic)

## About

Send the browser logs and JavaScript errors your New Relic browser agent already captures into Sazabi. The agent sends its data to the host in its `init.proxy.beacon` setting when one is set. Set it to your Sazabi beacon host and the agent sends its harvests to Sazabi. Sazabi answers the agent's page-view call itself, so the agent keeps running without a New Relic account behind it.

> [!WARNING]
>
> Setting `init.proxy.beacon` sends the agent's data to Sazabi instead of New Relic, not in addition to it.

Sazabi stores:

* **Browser logs**: every log the agent captures from `console` calls and the `newrelic.log` API, with its level, page URL, session ID, and page view ID.
* **JavaScript errors**: every uncaught or reported error, with its message, error class, stack trace, page, and session ID.

Page views, page timings, AJAX timings, page actions, session replay, and session traces aren't stored. Sazabi turns off session replay, session traces, and page actions in the agent.

## Prerequisites

* New Relic browser agent 1.243.0 or later (the first version that accepts a host for `init.proxy.beacon`), loaded with the copy-paste snippet or the `@newrelic/browser-agent` npm package
* Your Sazabi beacon host, shown above. Open the log source and copy the **Beacon host** from its setup screen. It is your intake URL without `https://`

## Set up in the dashboard

Sazabi authenticates with the public key in the beacon host, so it ignores the New Relic license key. Keep your existing `licenseKey` and `applicationID`: the agent needs non-empty values to start.

### Option A: Copy-paste snippet

Add `proxy` to the `NREUM.init` object in your snippet, next to its existing keys:

```javascript title="Browser agent snippet" theme={"system"}
NREUM.init = {
  // Keep your existing init keys.
  proxy: { beacon: "<your beacon host>" },
};
```

### Option B: npm package

Pass `proxy` in the `init` option of `BrowserAgent`:

```javascript title="app.js" theme={"system"}
import { BrowserAgent } from "@newrelic/browser-agent/loaders/browser-agent";

new BrowserAgent({
  init: {
    // Keep your existing init keys.
    proxy: { beacon: "<your beacon host>" },
  },
  info: existingInfo, // Your existing licenseKey, applicationID, and beacons.
  loader_config: existingLoaderConfig,
});
```

Replace `<your beacon host>` with the beacon host shown above. Use the host only, without `https://` or a path.

### Hand off the change

Commit the change on a new branch, push it, and open a pull request. Then deploy it and reload a page that runs the agent.

## Set up with the CLI

You can also register the New Relic Browser log source with the [Sazabi CLI](https://docs.sazabi.com/reference/cli.md) (installed and authenticated — see [CLI reference](https://docs.sazabi.com/reference/cli/log-sources.md)).

Registering the source mints the same intake URL the dashboard shows above (the public key is embedded in its hostname):

```bash theme={"system"}
sazabi log-sources create new_relic_browser
```

The command prints the intake URL for the new source. Drop `https://` and set the rest as `init.proxy.beacon` using one of the options above. Run `sazabi log-sources get <log-source-id>` at any time to reprint the endpoint, or `sazabi log-sources list` to see every log source in the project.

## Verify

Load a page that runs the agent and run `newrelic.log("sazabi new relic browser test")` in the browser console. Open the [Intake page](https://docs.sazabi.com/guides/instrument/intake.md) in the Sazabi dashboard and confirm a log from the **New Relic Browser** source appears within a minute, with `session.id` and `url.full` set.

## Troubleshooting

**No requests to the beacon host** — Agents older than 1.243.0 don't accept a host for `init.proxy.beacon`, and the setting is ignored when `proxy` sits outside `init`. Run `NREUM.init.proxy` in the browser console to check it.

**Errors arrive but logs don't** — The agent captures `console` calls made after it loads and calls to `newrelic.log`. Check the browser's network tab for `/browser/logs` requests to the beacon host.

**Data stopped appearing in New Relic** — Expected: the beacon now points at Sazabi.

## Further reading

> [card] [Intake](https://docs.sazabi.com/guides/instrument/intake.md)
>
> See per-source ingestion volume and health.

> [card] [Log sources](https://docs.sazabi.com/catalogs/log-sources.md)
>
> Browse the full log source catalog.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.