# bug-reporter-react

> Bug Reporter is a component of bug-reporter-react that can be attached to any app to take screenshots and report bugs

Latest version **1.1.4** (published 2022-03-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install bug-reporter-react
pnpm add bug-reporter-react
yarn add bug-reporter-react
bun add bug-reporter-react
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2022-03-31 |
| First published | 2022-03-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 3.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | consultadd_product |

## Links

- npm: https://www.npmjs.com/package/bug-reporter-react
- npm.io page: https://npm.io/package/bug-reporter-react

## Dependencies (7)

- [antd](https://npm.io/package/antd.md) ^4.18.3
- [react-icons](https://npm.io/package/react-icons.md) ^4.3.1
- [browser-name](https://npm.io/package/browser-name.md) ^1.0.2
- [html-to-image](https://npm.io/package/html-to-image.md) ^1.9.0
- [@ant-design/icons](https://npm.io/package/@ant-design/icons.md) ^4.7.0
- [react-screen-capture](https://npm.io/package/react-screen-capture.md) ^1.0.1
- [react-zoom-pan-pinch](https://npm.io/package/react-zoom-pan-pinch.md) ^2.1.3

## Recent versions

- 1.1.4 (latest) — 2022-03-31
- 1.1.3 — 2022-03-29
- 1.1.2 — 2022-03-29
- 1.1.1 — 2022-03-28
- 1.0.1 — 2022-03-28

## README

# Bug Reporter Library

>A react library for reporting a bug from your application.

## 🎁 Features

1. Take a snapshot of the webpage's screen or part of the screen and report a bug.

2. Along with snapshot, it stores and sends details such as **Image URL, Description, IP-Address, Email, Browser's Name** and **Path**. 

3. Compatible with any webpage. Easy to use.


## 🔧 Install

>**bug-reporter-react** is available on npm. It can be installed with the following command:

```
npm install bug-reporter-react --save
```

>**bug-reporter-react** is available on yarn as well. It can be installed with the following command:

```
yarn add bug-reporter-react
```


## 💡 Usage

1. Add this library to your application :
``` 
import BugReporter from 'bug-reporter-react' 
```

2. If your project dosen't have `antd Modal` then, add the following line :
```
import 'antd/dist/antd.css';
```

3. Save the **buttonStyle** into library to style the button, else it takes default style as -

` { position: "fixed", bottom: 90, right: 100 }`


4. It collects the `name` and `email` of the person sending the report.

5. Provide an API end-point which will send a URL as a post request call, that will return an object with keys -

` { image: , description: , ipAddress: , email: , browserName: , path: }`,
 where `image` will store the image's url of final marked image, `description` will store the bug's description provided, `path` will store the address of the page url where bug is been reported, `email` will store email address of the user who is reporting that bug, `ipAddress` will store the IP Address and `browserName` will store current browser's name where application is been executed.

6. Above mentioned informations can be used to report and track the type of bug along with the bug reporting person's details.

## 🧰 How to use Bug Reporter Library 

> Include these in your common component's script :


```
<BugReporter
          buttonStyle={{ position: "fixed", bottom: 90, right: 100, zIndex:2000 }}
          url={"http://localhost:8000/add"}
          name="Bob"
          email="bob.b@gmail.com"
          appName="bugTracker"
          getStatus={getStatus}
/>

```
```
// Shows Message Response

 const getStatus = (message, message_type)=>{
    message_type ? message.success(message) : message.error(message)
    }

```

## 🐛 How Bug Reporter Library works

- Once this library is added, user will get a button in their application. On clicking, it will hold the screen where they can take the screenshot. 

- It takes you into a Modal where a option is displayed to choose different colours and sizes. Using that one can mark multiple bugs and put a description on each.

- User will have a reset button to reset the Modal screen and a close button to close that model.

- Also, the user gets one description box below the Modal where one can provide additional information. Submit button will do a POST HTTP request and all the useful information will be sent onto that given URL end-point and will be stored into the database.

- By performing the above mentioned steps, one can report a bug and keep track of that bug along with the details of the person reporting the bug.  



## 🗄️ External Libraries used 

1. `@ant-design/icons`

2. `antd`

3. `html-to-image`

4. `react-screen-capture`

5. `react-zoom-pan-pinch`

---
_Source: https://npm.io/package/bug-reporter-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
