Star us on GitHub

Using in any frontend framework

Learn how to set up with any browser-based framework.
Import the script in your index html file.

Add the following script tag to the head section of your index.html file.

<html> <head> <script src=""></script> </head> <body> <!-- Your Application --> </body> </html>
Initialize the SDK.

Grab your project ID from setup and insert it in place of <YOUR_PROJECT_ID>. Call the init() method just below the initialize script tag in the head section of your index.html file. To get started, we recommend setting environment, version, and networkRecording. Refer to our docs on SDK configuration to read more about these options.

<html> <head> <script src=""></script> <script> H.init('<YOUR_PROJECT_ID>', { // Get your project ID from environment: 'production', version: 'commit:abcdefg12345', networkRecording: { enabled: true, recordHeadersAndBody: true, urlBlocklist: [ // insert urls you don't want to record here ], }, }); </script> </head> <body> <!-- Your Application --> </body> </html>
Identify users.

Identify users to tie their sessions/errors to their account. We suggest doing this after the authentication flow of your web app.

The first argument of identify will be searchable via the property identifier, and the second property is searchable by the key of each item in the object. Read more about this in our identifying users section.

H.identify('', { id: 'very-secure-id', phone: '867-5309', bestFriend: 'jenny' });
Verify installation

Check your dashboard for a new session. Don't see anything? Send us a message in our community and we can help debug.

Configure sourcemaps in CI. (optional)

To get properly enhanced stacktraces of your javascript app, we recommend instrumenting sourcemaps. If you deploy public sourcemaps, you can skip this step. Refer to our docs on sourcemaps to read more about this option.

# Upload sourcemaps to Highlight ... npx --yes @highlight-run/sourcemap-uploader upload --apiKey ${YOUR_ORG_API_KEY} --path ./build ...
Instrument your backend.

The next step is instrumenting your backend to tie logs/errors to your frontend sessions. Read more about this in our backend instrumentation section.