Local Development
Disable Highlight
Highlight will not run if H.init()
is not called or projectId
is undefined
. For most people, you don't want to record sessions from localhost
Here's an example of disabling Highlight while developing locally with H.init():
if (process.env.ENVIRONMENT !== 'dev') { H.init('<YOUR_PROJECT_ID') }
Here's an example of disabling Highlight while developing locally with environment variables:
H.init(process.env.HIGHLIGHT_PROJECT_ID) // process.env.HIGHLIGHT_PROJECT_ID is undefined.
Console Log Messages
Highlight monkey patches the browser's console
methods in order to record console messages. A side effect of this is that all the console messages' initiators will point to Highlight. This can make debugging hard because you can't see where console messages are coming from.
To prevent this from happening, you can:
-
Don't run Highlight locally
-
Disable console message recording locally
Here's an example of how you disable console message recording locally.
H.init('<YOUR_PROJECT_ID', { disableConsoleRecording: process.env.ENVIRONMENT === 'dev', })