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

# ReactJS SDK Guide

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

This guide will walk you through using the BugByBug React SDK in your project.

<Steps>
  <Step title="Install the SDK">
    You can install the BugByBug React SDK via npm.

    ```bash theme={null}
    npm install @bugbybug/react
    ```
  </Step>

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

    ```javascript theme={null}
    react init code here
    ```
  </Step>
</Steps>

## 3. Basic Usage

Once initialized, you can start using the SDK to capture bugs and errors.

### Manually capturing an Error

The SDK automatically captures errors within your projects, although, you still have the choose to capture or catch these errors manually like this:

```javascript theme={null}
try {
  this.doSomethingRisky();
} catch (error) {
  this.bugByBug.captureException(error, { component: 'LoginComponent' });
}
```

### Identifying users within your authentication

You can use `BugByBugService` in your authentication component to set the user context.

```javascript theme={null}
import { Component } from '@angular/core';
import { BugByBugService } from '@bugbybug/angular';

@Component({ ... })
export class LoginComponent {
  constructor(private bugByBug: BugByBugService) {}

  onLoginSuccess(user: any) {
    this.bugByBug.setUser(user.id, user.email);
  }
}
```

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

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

## API Reference

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