A New Relic browser token, the value that starts with NRJS-, is the key the New Relic browser agent uses to send page-load and JavaScript error data to your account. It is designed to be sent to visitors: it sits in the page that loads the agent. That makes it much less powerful than a user key, because it is meant for sending data in, not for reading your account. The danger is still real: anyone holding it can push fabricated browser events into your account, which pollutes dashboards and alerts, may count against your data allowance and can hide real problems. Rotate it first, then check what arrived.
Check your GitHub account for leaked secrets — free
- Provider
- New Relic
- Severity
- High
- Impact
- SaaS account access and billing
- Checked live by LeakWatch
- No
What a New Relic Browser API Token looks like
A browser token is the prefix NRJS- followed by 19 hexadecimal characters:
NRJS-XXXXXXXXXXXXXXXXXXX New Relic browser token (masked: prefix + 19 hex characters)
It usually appears in the browser agent snippet as a licenseKey value, or in a variable such as NEW_RELIC_BROWSER_KEY in a build configuration. Do not confuse it with the other New Relic values. The user API key (NRAK-) can read and manage data through the API and is far more sensitive. The ingest license key for servers and agents is a different 40-character value, and the account ID is only a number. If a file holds an NRAK- key as well, treat that one as the real emergency and see the New Relic user API key guide.
How New Relic Browser API Tokens get leaked
- Browser snippets in repositories. The agent snippet pasted into an HTML template, a layout file or a tag-manager export, with the key in plain text. This is normal for a public page, but it also ends up in places that expose more than the page.
- Front-end build configuration. A key kept in a
.envfile or a bundler config and inlined at build time, then committed along with the rest. - Infrastructure and deployment files. Terraform, Helm or compose files that set the browser application settings, committed with the values.
- Shared code samples. Tutorials, issues and support threads where a working snippet is pasted as it is.
- Copied projects. A template repository forked by many people, each keeping the original key.
What to do in the first hour
- Open the API keys page of your New Relic account (see the link below) and find the browser key by its name or by its last characters.
- Create a new browser key of the browser ingest type. Keep the old one for a few minutes: creating the new key first avoids a gap in browser monitoring.
- Deploy the new value in the page or build configuration, and confirm in the browser that data still arrives.
- Delete the exposed key from the same list. Hold on if it is the original browser key created with the application: New Relic documents that this key cannot be deleted by the user, and asks you to contact support to have it rotated.
- Check the data. Look at browser applications for events you did not generate: sessions from places or pages that do not exist, odd page URLs, a sudden jump in volume or error counts. Check the data ingest figures for the period since the exposure.
- Check alerts and dashboards. Fake events can trigger or mask alert conditions. Review them for changes you did not make.
- Look at the rest of the file. Rotate any user API key or license key found nearby, then clean the code. See I accidentally pushed an API key to GitHub.
Not sure what else leaked from the same repository? Run a free scan.
Revoke it at New Relic
New Relic keys are managed on the API keys page of your New Relic account, after you sign in with a user who can manage keys. The documentation describes the flow as creating a new key, updating the code that uses the old one, then deleting the old key from its row in the list. Deleted keys stop granting access. A person has not confirmed the exact menu wording for this guide, and the interface can change, so if what you see differs, look for the section where keys are created and listed, and follow New Relic’s documentation.
How LeakWatch detects it
The rule is called New Relic Browser API Token. It needs context: the word new-relic, newrelic or new_relic must appear, followed within about 20 characters by an assignment sign such as =, : or =>, and then NRJS- and exactly 19 hexadecimal characters, closed by a quote, a space, a semicolon or the end of the line. Letter case is ignored. A bare NRJS- value with no New Relic wording before it, a body of the wrong length, or a key with extra characters stuck to it is not reported. The severity is high. This type is not checked live: LeakWatch does not send any request to New Relic with the token it found.
LeakWatch detects this format but does not check it live: it can tell you the key is exposed, not whether it still works. Assume it does until you have revoked it.
FAQ
Is a browser token supposed to be public?
It is exposed to visitors by design, so seeing it in a web page is expected. It still deserves rotation when it is exposed beyond the page, because it lets others send data into your account.
Can someone read my data with an NRJS token?
It is an ingest key, meant for sending browser data in. Reading data requires a user key. Check for any user key in the same file, because that one can.
Do I need to rotate the key if I only see it in a public web page?
Not as an emergency. Rotate it if you see fake data, if volume looks wrong, or if the key was exposed together with other secrets.