API Reference
Error Monitoring
Getting Started
Welcome to Highlight
Integrations
Product Features
Session Replay
Tips
Menu

H.init()

This method is called to initialized Highlight in your application.

H.init(projectId?: string, options?: HighlightOptions) => void;
Copy
projectId

The projectId tells Highlight where to send data to. You can find your projectId on https://app.highlight.run/setup.

If projectId is not set, then Highlight will not send any data. You can use this as a mechanism to control which environments Highlight gets initialized in if the projectId is passed as an environment variable.

HighlightOptions
backendUrl

Specifies the URL that Highlight will send data to. You need this only to set up a proxy preventing third-party extensions, browser configurations, or VPN settings from blocking requests to Highlight servers.

See Proxying setup instructions for details.

manualStart

Specifies if Highlight should not automatically start recording when the app starts. This should be used with H.start() and H.stop() if you want to control when Highlight records.

The default value is false.

disableConsoleRecording

Specifies whether Highlight records console messages.

It can be helpful to set this to true while developing locally so you can see where console messages are being made in your source code.

The default value is false.

consoleMethodsToRecord

This configuration is available starting in version 2.11.0.

The value here will be ignored if disabledConsoleRecording is true.

The default value is ['assert', 'count', 'countReset', 'debug', 'dir', 'dirxml', 'error', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 'table', 'time', 'timeEnd', 'timeLog', 'trace', 'warn'].

enableSegmentIntegration

Allows patching of segment requests to enhance data automatically in your application (i.e. identify, track, etc..)

The default value is false.

environment

Specifies the environment your application is running in.

See Environments to see how setting the environment can help you move faster.

The default value is production.

networkRecording

Specifies how and what network requests and responses Highlight records.

See Recording Network Requests and Responses for more information.

version

Specifies the version of your application.

See Versioning Sessions and Versioning Errors to see how setting the version can help you move faster.

enableStrictPrivacy

Specifies whether Highlight should redact all text and image data during recording.

This is useful to make sure you are not recording any personally identifiable information without having to manually add annotations to elements you don't want to be recorded. See Privacy to learn more about the privacy options.

The default value is false.

integrations

Specifies the configurations for the integrations that Highlight supports. See Integrations for more information.

enableCanvasRecording

Specifies whether Highlight will record the contents of <canvas> elements. See Canvas for more information.

The default value is false.

This is only available on versions greater than 2.7.5 of highlight-run.

enablePerformanceRecording

Specifies whether Highlight will record performance metrics (e.g. FPS, device memory). See Performance Data for more information.

The default value is true.

sessionShortcut

Specifies the keyboard shortcut to open the current session in Highlight.

We support the same syntax as hotkeys for configuring the keyboard shortcut.

The default value is false.

// Disable the session shortcut. The is the default behavior. H.init('<YOUR_PROJECT_ID>', { sessionShortcut: false, }) // Enable the session shortcut with the Ctrl and 0 keys. H.init('<YOUR_PROJECT_ID>', { sessionShortcut: 'ctrl+0', }) // Enable the session shortcut with the Ctrl+0 and Ctrl+p keys. H.init('<YOUR_PROJECT_ID>', { sessionShortcut: 'ctrl+0,ctrl+p', }) // Enable the session shortcut with the Ctrl+0 and Command+0 keys. H.init('<YOUR_PROJECT_ID>', { sessionShortcut: 'ctrl+0,command+0', })
Copy

See Session Shortcut for more information.

feedbackWidget

Specifies the configuration for the Highlight feedback widget. This widget is used to collect user feedback. The feedback is collected in the context of the session.

tracingOrigins

Specifies where the backend of the app lives. If specified, Highlight will attach the X-Highlight-Request header to outgoing requests whose destination URLs match a substring or regexp from this list, so that backend errors can be linked back to the session. If true is specified, all requests to the current domain will be matched. Example tracingOrigins: ['localhost', /^\//, 'backend.myapp.com']