I’m trying to automate Browser Agent update process. My Node.js App is running on vercel (uses AWS lambda behind the scenes). It’s not possible to inject script at runtime using
newrelic.getBrowserTimingHeader() because most of the time my app hosted from cdn cache.
So my solution is to download fresh Agent script before building an app. Looks like
newrelic lib can not be used to fetch the script only, because it requires an active transaction. I can’t find the way to get the script only or access internal config object. Underlying
collector.newrelic.com API seems not to be intended for public usage.
I’ve found the doc wich list options to get script programmatically but it turns out that v2 API won’t work with SPA (it always returns non-spa agent code) and the page with possible solutions for spa has no solutions at all
Am I missing something or the only way to automate the update of SPA+PRO Browser Agent script is to download the actual script from loader endpoint and manually add all the required configuration?