> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bugbybug.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Browser SDK Guide

> Learn how to set up our Browser SDK in your project

This guide will walk you through integrating and using the BugByBug Browser SDK in your web application.

<Steps>
  <Step title="Install the SDK">
    ```bash theme={null}
    npm install @bugbybug/browser
    ```
  </Step>

  <Step title="Import into your app">
    Initialization the SDK into your `index.js` or `main.ts`

    ```javascript theme={null}
    import * as BugByBug from '@bugbybug/browser';

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

    app.mount('#app');
    ```
  </Step>
</Steps>

## 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:

```javascript theme={null}
BugByBug.setUser('user-123', 'john.doe@example.com');
```

### Capturing an Error Manually

```javascript theme={null}
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.

<Tip>
  For more detailed information on specific framework integrations, refer to their dedicated guides:

  * [React.js SDK Guide](/sdk-guides/reactjs)
  * [Vue.js SDK Guide](/sdk-guides/vuejs)
  * [Angular.js SDK Guide](/sdk-guides/angularjs)
</Tip>

## API Reference

For a complete list of available methods and their signatures, refer to the [API Reference](/api-reference/introduction).
