@arantic/bugpin-widget 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +222 -0
- package/package.json +26 -3
package/README.md
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# BugPin Widget
|
|
2
|
+
|
|
3
|
+
Embeddable visual bug reporting widget for web applications. Capture screenshots, annotate issues, and submit bug reports with ease.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Screenshot Capture** - Full page or visible area
|
|
8
|
+
- **Annotation Tools** - Draw, highlight, blur, and add text
|
|
9
|
+
- **Privacy First** - Self-hosted, your data stays on your servers
|
|
10
|
+
- **Customizable** - Match your brand colors and style
|
|
11
|
+
- **Lightweight** - Under 130KB gzipped
|
|
12
|
+
- **Dark Mode** - Automatic theme detection
|
|
13
|
+
- **Responsive** - Works on all devices
|
|
14
|
+
- **Framework Agnostic** - Works with React, Vue, Angular, Svelte, .NET, and more
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
### Script Tag (Recommended)
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<script
|
|
22
|
+
src="https://your-bugpin-server.com/widget.js"
|
|
23
|
+
data-api-key="your-project-api-key"
|
|
24
|
+
async
|
|
25
|
+
></script>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### npm Package
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install @arantic/bugpin-widget
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```javascript
|
|
35
|
+
import BugPin from '@arantic/bugpin-widget';
|
|
36
|
+
|
|
37
|
+
BugPin.init({
|
|
38
|
+
apiKey: 'your-project-api-key',
|
|
39
|
+
serverUrl: 'https://your-bugpin-server.com'
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Quick Start
|
|
44
|
+
|
|
45
|
+
### React / Next.js
|
|
46
|
+
|
|
47
|
+
```jsx
|
|
48
|
+
import { useEffect } from 'react';
|
|
49
|
+
import BugPin from '@arantic/bugpin-widget';
|
|
50
|
+
|
|
51
|
+
function App() {
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
BugPin.init({
|
|
54
|
+
apiKey: process.env.NEXT_PUBLIC_BUGPIN_API_KEY,
|
|
55
|
+
serverUrl: process.env.NEXT_PUBLIC_BUGPIN_SERVER_URL
|
|
56
|
+
});
|
|
57
|
+
}, []);
|
|
58
|
+
|
|
59
|
+
return <div>Your app</div>;
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Vue / Nuxt
|
|
64
|
+
|
|
65
|
+
```vue
|
|
66
|
+
<script setup>
|
|
67
|
+
import { onMounted } from 'vue';
|
|
68
|
+
import BugPin from '@arantic/bugpin-widget';
|
|
69
|
+
|
|
70
|
+
onMounted(() => {
|
|
71
|
+
BugPin.init({
|
|
72
|
+
apiKey: import.meta.env.VITE_BUGPIN_API_KEY,
|
|
73
|
+
serverUrl: import.meta.env.VITE_BUGPIN_SERVER_URL
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
</script>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### TypeScript
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
import BugPin, { type WidgetConfig } from '@arantic/bugpin-widget';
|
|
83
|
+
|
|
84
|
+
const config: Partial<WidgetConfig> & { apiKey: string } = {
|
|
85
|
+
apiKey: 'your-api-key',
|
|
86
|
+
serverUrl: 'https://bugs.example.com',
|
|
87
|
+
position: 'bottom-right',
|
|
88
|
+
theme: 'auto'
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
BugPin.init(config);
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Configuration
|
|
95
|
+
|
|
96
|
+
| Option | Type | Default | Description |
|
|
97
|
+
|--------|------|---------|-------------|
|
|
98
|
+
| `apiKey` | `string` | **Required** | Your project API key |
|
|
99
|
+
| `serverUrl` | `string` | **Required** | BugPin server URL |
|
|
100
|
+
| `position` | `string` | `'bottom-right'` | Widget position: `'bottom-right'`, `'bottom-left'`, `'top-right'`, `'top-left'` |
|
|
101
|
+
| `theme` | `string` | `'auto'` | Theme: `'light'`, `'dark'`, or `'auto'` |
|
|
102
|
+
| `buttonText` | `string` | `'Found a bug?'` | Button text |
|
|
103
|
+
|
|
104
|
+
## API Methods
|
|
105
|
+
|
|
106
|
+
### `BugPin.init(config)`
|
|
107
|
+
|
|
108
|
+
Initialize the widget with your configuration.
|
|
109
|
+
|
|
110
|
+
```javascript
|
|
111
|
+
BugPin.init({
|
|
112
|
+
apiKey: 'bp_proj_abc123',
|
|
113
|
+
serverUrl: 'https://bugs.example.com'
|
|
114
|
+
});
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### `BugPin.open()`
|
|
118
|
+
|
|
119
|
+
Programmatically open the bug report dialog.
|
|
120
|
+
|
|
121
|
+
```javascript
|
|
122
|
+
document.getElementById('report-bug').addEventListener('click', () => {
|
|
123
|
+
BugPin.open();
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### `BugPin.close()`
|
|
128
|
+
|
|
129
|
+
Programmatically close the bug report dialog.
|
|
130
|
+
|
|
131
|
+
```javascript
|
|
132
|
+
BugPin.close();
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Framework Examples
|
|
136
|
+
|
|
137
|
+
### .NET / Blazor
|
|
138
|
+
|
|
139
|
+
```html
|
|
140
|
+
<!-- In _Layout.cshtml or wwwroot/index.html -->
|
|
141
|
+
<script
|
|
142
|
+
src="@Configuration["BugPin:ServerUrl"]/widget.js"
|
|
143
|
+
data-api-key="@Configuration["BugPin:ApiKey"]"
|
|
144
|
+
async
|
|
145
|
+
></script>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Angular
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
// app.component.ts
|
|
152
|
+
import { Component, OnInit } from '@angular/core';
|
|
153
|
+
import BugPin from '@arantic/bugpin-widget';
|
|
154
|
+
|
|
155
|
+
@Component({
|
|
156
|
+
selector: 'app-root',
|
|
157
|
+
templateUrl: './app.component.html'
|
|
158
|
+
})
|
|
159
|
+
export class AppComponent implements OnInit {
|
|
160
|
+
ngOnInit() {
|
|
161
|
+
BugPin.init({
|
|
162
|
+
apiKey: environment.bugpinApiKey,
|
|
163
|
+
serverUrl: environment.bugpinServerUrl
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Svelte
|
|
170
|
+
|
|
171
|
+
```svelte
|
|
172
|
+
<script>
|
|
173
|
+
import { onMount } from 'svelte';
|
|
174
|
+
import BugPin from '@arantic/bugpin-widget';
|
|
175
|
+
|
|
176
|
+
onMount(() => {
|
|
177
|
+
BugPin.init({
|
|
178
|
+
apiKey: import.meta.env.VITE_BUGPIN_API_KEY,
|
|
179
|
+
serverUrl: import.meta.env.VITE_BUGPIN_SERVER_URL
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
</script>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Environment Variables
|
|
186
|
+
|
|
187
|
+
Store your API key securely using environment variables:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# Next.js
|
|
191
|
+
NEXT_PUBLIC_BUGPIN_API_KEY=bp_proj_abc123
|
|
192
|
+
NEXT_PUBLIC_BUGPIN_SERVER_URL=https://bugs.example.com
|
|
193
|
+
|
|
194
|
+
# Vite
|
|
195
|
+
VITE_BUGPIN_API_KEY=bp_proj_abc123
|
|
196
|
+
VITE_BUGPIN_SERVER_URL=https://bugs.example.com
|
|
197
|
+
|
|
198
|
+
# Vue CLI
|
|
199
|
+
VUE_APP_BUGPIN_API_KEY=bp_proj_abc123
|
|
200
|
+
VUE_APP_BUGPIN_SERVER_URL=https://bugs.example.com
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Getting Your API Key
|
|
204
|
+
|
|
205
|
+
1. Deploy BugPin server (self-hosted or use the official Docker image)
|
|
206
|
+
2. Log in to the BugPin admin panel
|
|
207
|
+
3. Create a new project or select an existing one
|
|
208
|
+
4. Copy the API key from the project settings
|
|
209
|
+
|
|
210
|
+
## Documentation
|
|
211
|
+
|
|
212
|
+
For complete documentation, visit: [BugPin Documentation](https://docs.bugpin.io)
|
|
213
|
+
|
|
214
|
+
## License
|
|
215
|
+
|
|
216
|
+
MIT
|
|
217
|
+
|
|
218
|
+
## Support
|
|
219
|
+
|
|
220
|
+
- [Documentation](https://docs.bugpin.io)
|
|
221
|
+
- [Report Issues](https://github.com/bugpin/bugpin-ce/issues)
|
|
222
|
+
- [Discussions](https://github.com/bugpin/bugpin-ce/discussions)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arantic/bugpin-widget",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Embeddable visual bug reporting widget - Capture screenshots, annotate issues, and submit bug reports",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/widget.cjs.js",
|
|
7
7
|
"module": "dist/widget.esm.js",
|
|
@@ -13,8 +13,31 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
|
-
"dist"
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
17
18
|
],
|
|
19
|
+
"keywords": [
|
|
20
|
+
"bug-reporting",
|
|
21
|
+
"feedback",
|
|
22
|
+
"screenshot",
|
|
23
|
+
"annotation",
|
|
24
|
+
"widget",
|
|
25
|
+
"issue-tracker",
|
|
26
|
+
"visual-feedback",
|
|
27
|
+
"bugpin",
|
|
28
|
+
"self-hosted"
|
|
29
|
+
],
|
|
30
|
+
"author": "Arantic Digital",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/bugpin/bugpin-ce.git",
|
|
35
|
+
"directory": "src/widget"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://bugpin.io",
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/bugpin/bugpin-ce/issues"
|
|
40
|
+
},
|
|
18
41
|
"publishConfig": {
|
|
19
42
|
"access": "public"
|
|
20
43
|
},
|