Skip to main content
This guide will walk you through integrating and using the BugByBug Browser SDK in your web application.
1

Install the SDK

npm install @bugbybug/browser
2

Import into your app

Initialization the SDK into your index.js or main.ts
import * as BugByBug from '@bugbybug/browser';

BugByBug.init({
  apiKey: 'YOUR_PROJECT_API_KEY', // Starts with bbb_
  environment: 'production'
});

app.mount('#app');

Basic Usage

Once initialized, you can start using the SDK to track users that have issues or errors within your project.

Identifying Users

To track users experiencing errors, you can do achieve like this:
BugByBug.setUser('user-123', '[email protected]');

Capturing an Error Manually

try {
  // Your code that might throw an error
  throw new Error('Something went wrong!');
} catch (error) {
  BugByBug.captureException(error);
}

Integrations

The Browser SDK can be extended with various integrations for specific frameworks or functionalities.
For more detailed information on specific framework integrations, refer to their dedicated guides:

API Reference

For a complete list of available methods and their signatures, refer to the API Reference.