-
Notifications
You must be signed in to change notification settings - Fork 27
updated example of injecting browser agent #84
updated example of injecting browser agent #84
Conversation
README.md
Outdated
@@ -131,7 +144,7 @@ Error.getInitialProps = ({ res, err }) => { | |||
export default Error; | |||
``` | |||
|
|||
The example above assumes that both the New Relic Browser and Node.js agents are integrated. `getInitialProps` function's `if` statement checks whether an error was thrown on the server side (`typeof window === "undefined"`) and if it was the case, it `requires` New Relic Node.js agent and sends an `err` with `noticeError` method. Otherwise it assumes the error was thrown on the front-end side, and uses the browser agent to send the error to New Relic by using `window.newrelic.noticeError(err)`. | |||
The example above assumes that both the New Relic Browser and Node.js agents are [integrated](#client-side-instrumentation). `getInitialProps` function's `if` statement checks whether an error was thrown on the server side (`typeof window === "undefined"`) and if it was the case, it `requires` New Relic Node.js agent and sends an `err` with `noticeError` method. Otherwise it assumes the error was thrown on the front-end side, and uses the browser agent to send the error to New Relic by using `window.newrelic.noticeError(err)`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clarity, I think I'd prefer
The getInitialProps
function's if
statement
to not having the initial "The."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The American Mathematical Society's style guide recommends not beginning a sentence with a symbol. I think that helps reading, because the eyes use both punctuation and capitalisation to see a new sentence. I bet our doc writers have similar ideas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
took me a while to figure out the ask here but updated!
…ample updated example of injecting browser agent
Proposed Release Notes
Links
Details