@arantic/bugpin-widget 0.1.0 → 0.1.2
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 +216 -0
- package/package.json +26 -3
package/README.md
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
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
|
+
```bash
|
|
19
|
+
npm install @arantic/bugpin-widget
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```javascript
|
|
25
|
+
import BugPin from '@arantic/bugpin-widget';
|
|
26
|
+
|
|
27
|
+
BugPin.init({
|
|
28
|
+
apiKey: 'your-project-api-key',
|
|
29
|
+
serverUrl: 'https://your-bugpin-server.com'
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Configuration
|
|
34
|
+
|
|
35
|
+
The widget automatically fetches its configuration from the BugPin server based on your API key. All visual settings (theme, position, colors, button text) are managed in the BugPin admin UI.
|
|
36
|
+
|
|
37
|
+
### Required Options
|
|
38
|
+
|
|
39
|
+
| Option | Type | Description |
|
|
40
|
+
|--------|------|-------------|
|
|
41
|
+
| `apiKey` | `string` | Your project API key (from BugPin admin) |
|
|
42
|
+
| `serverUrl` | `string` | Your BugPin server URL |
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Framework Examples
|
|
46
|
+
|
|
47
|
+
### React / Vite
|
|
48
|
+
|
|
49
|
+
```jsx
|
|
50
|
+
import { useEffect } from 'react';
|
|
51
|
+
import BugPin from '@arantic/bugpin-widget';
|
|
52
|
+
|
|
53
|
+
function App() {
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
BugPin.init({
|
|
56
|
+
apiKey: import.meta.env.VITE_BUGPIN_API_KEY,
|
|
57
|
+
serverUrl: import.meta.env.VITE_BUGPIN_SERVER_URL
|
|
58
|
+
});
|
|
59
|
+
}, []);
|
|
60
|
+
|
|
61
|
+
return <div>Your app</div>;
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Next.js
|
|
66
|
+
|
|
67
|
+
```jsx
|
|
68
|
+
import { useEffect } from 'react';
|
|
69
|
+
import BugPin from '@arantic/bugpin-widget';
|
|
70
|
+
|
|
71
|
+
function App() {
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
BugPin.init({
|
|
74
|
+
apiKey: process.env.NEXT_PUBLIC_BUGPIN_API_KEY,
|
|
75
|
+
serverUrl: process.env.NEXT_PUBLIC_BUGPIN_SERVER_URL
|
|
76
|
+
});
|
|
77
|
+
}, []);
|
|
78
|
+
|
|
79
|
+
return <div>Your app</div>;
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Vue / Nuxt
|
|
84
|
+
|
|
85
|
+
```vue
|
|
86
|
+
<script setup>
|
|
87
|
+
import { onMounted } from 'vue';
|
|
88
|
+
import BugPin from '@arantic/bugpin-widget';
|
|
89
|
+
|
|
90
|
+
onMounted(() => {
|
|
91
|
+
BugPin.init({
|
|
92
|
+
apiKey: import.meta.env.VITE_BUGPIN_API_KEY,
|
|
93
|
+
serverUrl: import.meta.env.VITE_BUGPIN_SERVER_URL
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
</script>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Angular
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
// app.component.ts
|
|
103
|
+
import { Component, OnInit } from '@angular/core';
|
|
104
|
+
import BugPin from '@arantic/bugpin-widget';
|
|
105
|
+
|
|
106
|
+
@Component({
|
|
107
|
+
selector: 'app-root',
|
|
108
|
+
templateUrl: './app.component.html'
|
|
109
|
+
})
|
|
110
|
+
export class AppComponent implements OnInit {
|
|
111
|
+
ngOnInit() {
|
|
112
|
+
BugPin.init({
|
|
113
|
+
apiKey: environment.bugpinApiKey,
|
|
114
|
+
serverUrl: environment.bugpinServerUrl
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### TypeScript / Vanilla JavaScript
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
import BugPin from '@arantic/bugpin-widget';
|
|
124
|
+
|
|
125
|
+
// Initialize when DOM is ready
|
|
126
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
127
|
+
BugPin.init({
|
|
128
|
+
apiKey: 'your-api-key',
|
|
129
|
+
serverUrl: 'https://bugpin.example.com'
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### .NET / Blazor
|
|
135
|
+
|
|
136
|
+
```csharp
|
|
137
|
+
// Services/BugPinService.cs
|
|
138
|
+
public class BugPinService
|
|
139
|
+
{
|
|
140
|
+
private readonly IJSRuntime _js;
|
|
141
|
+
|
|
142
|
+
public BugPinService(IJSRuntime js) => _js = js;
|
|
143
|
+
|
|
144
|
+
public async Task InitializeAsync(string apiKey, string serverUrl)
|
|
145
|
+
{
|
|
146
|
+
await _js.InvokeVoidAsync("eval",
|
|
147
|
+
$"import('@arantic/bugpin-widget').then(m => m.default.init({{apiKey: '{apiKey}', serverUrl: '{serverUrl}'}}))");
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
```csharp
|
|
153
|
+
// Program.cs or Startup.cs
|
|
154
|
+
builder.Services.AddScoped<BugPinService>();
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
```razor
|
|
158
|
+
@inject BugPinService BugPin
|
|
159
|
+
@inject IConfiguration Config
|
|
160
|
+
|
|
161
|
+
@code {
|
|
162
|
+
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
163
|
+
{
|
|
164
|
+
if (firstRender)
|
|
165
|
+
{
|
|
166
|
+
await BugPin.InitializeAsync(
|
|
167
|
+
Config["BugPin:ApiKey"],
|
|
168
|
+
Config["BugPin:ServerUrl"]
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Environment Variables
|
|
176
|
+
|
|
177
|
+
Store your API key in environment variables (see framework examples above for usage):
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# Vite (React, Vue) - .env
|
|
181
|
+
VITE_BUGPIN_API_KEY=your-api-key
|
|
182
|
+
VITE_BUGPIN_SERVER_URL=https://bugpin.example.com
|
|
183
|
+
|
|
184
|
+
# Next.js - .env.local
|
|
185
|
+
NEXT_PUBLIC_BUGPIN_API_KEY=your-api-key
|
|
186
|
+
NEXT_PUBLIC_BUGPIN_SERVER_URL=https://bugpin.example.com
|
|
187
|
+
|
|
188
|
+
# .NET (appsettings.json)
|
|
189
|
+
{
|
|
190
|
+
"BugPin": {
|
|
191
|
+
"ApiKey": "your-api-key",
|
|
192
|
+
"ServerUrl": "https://bugpin.example.com"
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Getting Your API Key
|
|
198
|
+
|
|
199
|
+
1. Deploy BugPin server (self-hosted or use the official Docker image)
|
|
200
|
+
2. Log in to the BugPin admin panel
|
|
201
|
+
3. Create a new project or select an existing one
|
|
202
|
+
4. Copy the API key from the project settings
|
|
203
|
+
|
|
204
|
+
## Documentation
|
|
205
|
+
|
|
206
|
+
For complete documentation, visit: [BugPin Documentation](https://docs.bugpin.io)
|
|
207
|
+
|
|
208
|
+
## License
|
|
209
|
+
|
|
210
|
+
MIT
|
|
211
|
+
|
|
212
|
+
## Support
|
|
213
|
+
|
|
214
|
+
- [Documentation](https://docs.bugpin.io)
|
|
215
|
+
- [Report Issues](https://github.com/bugpin/bugpin/issues)
|
|
216
|
+
- [Discussions](https://github.com/bugpin/bugpin/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.2",
|
|
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/aranticlabs/bugpin.git",
|
|
35
|
+
"directory": "src/widget"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://bugpin.io",
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/aranticlabs/bugpin/issues"
|
|
40
|
+
},
|
|
18
41
|
"publishConfig": {
|
|
19
42
|
"access": "public"
|
|
20
43
|
},
|