@feedbackfun/js 0.2.0 β 0.2.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 +61 -168
- package/dist/feedbackfun-widget.esm.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,126 +1,62 @@
|
|
|
1
|
-
#
|
|
1
|
+
# π― feedbackfun JS
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@feedbackfun/js)
|
|
4
|
+
[](https://www.npmjs.com/package/@feedbackfun/js)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://bundlephobia.com/package/@feedbackfun/js)
|
|
2
7
|
|
|
3
8
|
Complete customer feedback ecosystem - capture feature requests, bug reports, manage product roadmaps, and provide real-time chat support, all in one embeddable widget.
|
|
4
9
|
|
|
5
10
|
## Installation
|
|
6
11
|
|
|
7
|
-
### NPM Package
|
|
8
|
-
|
|
9
12
|
```bash
|
|
10
13
|
npm install @feedbackfun/js
|
|
11
14
|
```
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
## Features
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
- π **Feature Requests** - Collect and prioritize product ideas from your users
|
|
19
|
+
- π **Bug Reporting** - Visual bug reports with automatic screenshot capture and context
|
|
20
|
+
- πΊοΈ **Product Roadmap** - Interactive roadmap with voting and status tracking
|
|
21
|
+
- π¬ **Real-time Chat Support** - Instant messaging between users and your support team
|
|
22
|
+
- π€ **User Authentication** - Associate feedback with authenticated users for better context
|
|
23
|
+
- π― **Click-anywhere Feedback** - Pin feedback to any element on your website
|
|
24
|
+
- π¨ **Customizable Branding** - Match your brand with custom colors and themes
|
|
25
|
+
- π **Dark Mode Support** - Automatic dark/light theme detection
|
|
26
|
+
- π¦ **Zero Configuration** - Widget settings managed via dashboard
|
|
27
|
+
- π **TypeScript Support** - Full TypeScript definitions included
|
|
21
28
|
|
|
22
29
|
## Quick Start
|
|
23
30
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
```typescript
|
|
27
|
-
import feedbackfun from '@feedbackfun/js';
|
|
28
|
-
|
|
29
|
-
// Initialize widget (config is fetched from your dashboard)
|
|
30
|
-
await feedbackfun.init({
|
|
31
|
-
apiKey: 'your-api-key',
|
|
32
|
-
projectId: 'your-project-id'
|
|
33
|
-
});
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### React
|
|
37
|
-
|
|
38
|
-
```typescript
|
|
39
|
-
import feedbackfun from '@feedbackfun/js';
|
|
40
|
-
import { useEffect } from 'react';
|
|
41
|
-
|
|
42
|
-
function App() {
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
feedbackfun.init({
|
|
45
|
-
apiKey: process.env.REACT_APP_FEEDBACKFUN_KEY!,
|
|
46
|
-
projectId: process.env.REACT_APP_FEEDBACKFUN_PROJECT_ID!
|
|
47
|
-
});
|
|
31
|
+
1. **Install the package**
|
|
48
32
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return <div>Your App</div>;
|
|
53
|
-
}
|
|
33
|
+
```bash
|
|
34
|
+
npm install @feedbackfun/js
|
|
54
35
|
```
|
|
55
36
|
|
|
56
|
-
|
|
37
|
+
2. **Initialize the widget**
|
|
57
38
|
|
|
58
39
|
```typescript
|
|
59
|
-
'use client';
|
|
60
|
-
import feedbackfun from '@feedbackfun/js';
|
|
61
|
-
import { useEffect } from 'react';
|
|
62
|
-
|
|
63
|
-
export default function Layout({ children }) {
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
feedbackfun.init({
|
|
66
|
-
apiKey: process.env.NEXT_PUBLIC_FEEDBACKFUN_KEY!,
|
|
67
|
-
projectId: process.env.NEXT_PUBLIC_FEEDBACKFUN_PROJECT_ID!
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
return () => feedbackfun.destroy();
|
|
71
|
-
}, []);
|
|
72
|
-
|
|
73
|
-
return <>{children}</>;
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Vue.js
|
|
78
|
-
|
|
79
|
-
```vue
|
|
80
|
-
<script setup>
|
|
81
|
-
import { onMounted, onUnmounted } from 'vue';
|
|
82
40
|
import feedbackfun from '@feedbackfun/js';
|
|
83
41
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
apiKey: import.meta.env.VITE_FEEDBACKFUN_KEY,
|
|
87
|
-
projectId: import.meta.env.VITE_FEEDBACKFUN_PROJECT_ID
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
onUnmounted(() => {
|
|
92
|
-
feedbackfun.destroy();
|
|
93
|
-
});
|
|
94
|
-
</script>
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### Vanilla JavaScript
|
|
98
|
-
|
|
99
|
-
```javascript
|
|
100
|
-
import feedbackfun from '@feedbackfun/js';
|
|
101
|
-
|
|
102
|
-
feedbackfun.init({
|
|
42
|
+
// Initialize widget (config is fetched from your dashboard)
|
|
43
|
+
await feedbackfun.init({
|
|
103
44
|
apiKey: 'your-api-key',
|
|
104
45
|
projectId: 'your-project-id'
|
|
105
46
|
});
|
|
106
|
-
|
|
107
|
-
// Later, when cleaning up
|
|
108
|
-
feedbackfun.destroy();
|
|
109
47
|
```
|
|
110
48
|
|
|
111
|
-
##
|
|
112
|
-
|
|
113
|
-
### `init(config)`
|
|
49
|
+
## Configuration (InitConfig)
|
|
114
50
|
|
|
115
|
-
|
|
51
|
+
All widget configuration (colors, display mode, trigger selectors, branding, etc.) is managed via the FeedbackFun dashboard at [feedbackfun.com](https://feedbackfun.com). The `init()` method only requires API credentials.
|
|
116
52
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
**Returns:** `Promise<FeedbackfunWidget>` - The widget instance
|
|
53
|
+
| Option | Type | Required | Description |
|
|
54
|
+
|--------|------|----------|-------------|
|
|
55
|
+
| `apiKey` | `string` | Yes | Your FeedbackFun API key from the dashboard |
|
|
56
|
+
| `projectId` | `string` | Yes | Your project ID from the dashboard |
|
|
122
57
|
|
|
123
58
|
**Example:**
|
|
59
|
+
|
|
124
60
|
```typescript
|
|
125
61
|
await feedbackfun.init({
|
|
126
62
|
apiKey: 'your-api-key',
|
|
@@ -128,114 +64,71 @@ await feedbackfun.init({
|
|
|
128
64
|
});
|
|
129
65
|
```
|
|
130
66
|
|
|
131
|
-
|
|
67
|
+
## API (FeedbackfunWidget)
|
|
132
68
|
|
|
133
|
-
|
|
69
|
+
| Method | Description |
|
|
70
|
+
|--------|-------------|
|
|
71
|
+
| `init(config)` | Initialize the widget with API credentials. Returns `Promise<FeedbackfunWidget>` |
|
|
72
|
+
| `destroy()` | Cleanup and destroy the widget instance. Important for SPAs to prevent memory leaks |
|
|
73
|
+
| `getInstance()` | Get the current widget instance. Returns `FeedbackfunWidget \| null` |
|
|
74
|
+
| `setUserInfo(user)` | Set authenticated user information to associate feedback with specific users |
|
|
75
|
+
| `clearUserInfo()` | Clear user information (useful for logout scenarios) |
|
|
76
|
+
| `setPrimaryColor(color)` | Runtime override of the primary theme color configured in dashboard |
|
|
77
|
+
| `setPrimaryForeground(color)` | Runtime override of the primary foreground color configured in dashboard |
|
|
134
78
|
|
|
135
|
-
|
|
136
|
-
```typescript
|
|
137
|
-
feedbackfun.destroy();
|
|
138
|
-
```
|
|
79
|
+
### Method Details
|
|
139
80
|
|
|
140
|
-
|
|
81
|
+
#### `setUserInfo(user)`
|
|
141
82
|
|
|
142
|
-
|
|
83
|
+
Set authenticated user information to associate feedback with specific users. You can pass any custom data fields beyond the standard ones.
|
|
143
84
|
|
|
144
|
-
**
|
|
85
|
+
**Standard Parameters:**
|
|
145
86
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
### `setUserInfo(user)`
|
|
87
|
+
| Parameter | Type | Required | Description |
|
|
88
|
+
|-----------|------|----------|-------------|
|
|
89
|
+
| `user.id` | `string` | Yes | User's unique identifier |
|
|
90
|
+
| `user.name` | `string` | No | User's display name |
|
|
91
|
+
| `user.email` | `string` | No | User's email address |
|
|
152
92
|
|
|
153
|
-
|
|
93
|
+
**Custom Fields:**
|
|
154
94
|
|
|
155
|
-
|
|
156
|
-
- `user.id` (string, required): User's unique identifier
|
|
157
|
-
- `user.name` (string, optional): User's display name
|
|
158
|
-
- `user.email` (string, optional): User's email address
|
|
159
|
-
- `user.avatar` (string, optional): URL to user's avatar image
|
|
95
|
+
You can pass any additional custom data as needed (e.g., `avatar`, `role`, `plan`, `company`, etc.). All custom fields will be stored and associated with the user's feedback.
|
|
160
96
|
|
|
161
97
|
**Example:**
|
|
98
|
+
|
|
162
99
|
```typescript
|
|
163
100
|
feedbackfun.setUserInfo({
|
|
164
101
|
id: 'user-123',
|
|
165
102
|
name: 'John Doe',
|
|
166
103
|
email: 'john@example.com',
|
|
167
|
-
|
|
104
|
+
// Custom fields - pass any data you want
|
|
105
|
+
avatar: 'https://example.com/avatar.jpg',
|
|
106
|
+
role: 'admin',
|
|
107
|
+
plan: 'premium',
|
|
108
|
+
company: 'Acme Inc'
|
|
168
109
|
});
|
|
169
110
|
```
|
|
170
111
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
Clear user information (useful for logout scenarios).
|
|
174
|
-
|
|
175
|
-
**Example:**
|
|
176
|
-
```typescript
|
|
177
|
-
feedbackfun.clearUserInfo();
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### `setPrimaryColor(color)`
|
|
112
|
+
#### `setPrimaryColor(color)`
|
|
181
113
|
|
|
182
114
|
Runtime override of the primary theme color configured in your dashboard.
|
|
183
115
|
|
|
184
|
-
**Parameters:**
|
|
185
|
-
- `color` (string): CSS color value (hex, rgb, etc.)
|
|
186
|
-
|
|
187
116
|
**Example:**
|
|
117
|
+
|
|
188
118
|
```typescript
|
|
189
119
|
feedbackfun.setPrimaryColor('#3b82f6');
|
|
190
120
|
```
|
|
191
121
|
|
|
192
|
-
|
|
122
|
+
#### `setPrimaryForeground(color)`
|
|
193
123
|
|
|
194
124
|
Runtime override of the primary foreground color configured in your dashboard.
|
|
195
125
|
|
|
196
|
-
**Parameters:**
|
|
197
|
-
- `color` (string): CSS color value (hex, rgb, etc.)
|
|
198
|
-
|
|
199
126
|
**Example:**
|
|
200
|
-
```typescript
|
|
201
|
-
feedbackfun.setPrimaryForeground('#ffffff');
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
## Configuration
|
|
205
|
-
|
|
206
|
-
All widget configuration (colors, display mode, trigger selectors, branding, etc.) is managed via the FeedbackFun dashboard. Simply log in to [feedbackfun.com](https://feedbackfun.com), navigate to your project settings, and configure the widget appearance and behavior.
|
|
207
|
-
|
|
208
|
-
No configuration needed in code!
|
|
209
|
-
|
|
210
|
-
## Features
|
|
211
|
-
|
|
212
|
-
- **Feature Requests**: Collect and prioritize product ideas from your users
|
|
213
|
-
- **Bug Reporting**: Visual bug reports with automatic screenshot capture and context
|
|
214
|
-
- **Product Roadmap**: Interactive roadmap with voting and status tracking
|
|
215
|
-
- **Real-time Chat Support**: Instant messaging between users and your support team
|
|
216
|
-
- **User Authentication**: Associate feedback with authenticated users for better context
|
|
217
|
-
- **Click-anywhere feedback**: Pin feedback to any element on your website
|
|
218
|
-
- **Customizable Branding**: Match your brand with custom colors and themes
|
|
219
|
-
- **Dark Mode Support**: Automatic dark/light theme detection
|
|
220
|
-
|
|
221
|
-
## TypeScript Support
|
|
222
|
-
|
|
223
|
-
Full TypeScript definitions included. Import types if needed:
|
|
224
127
|
|
|
225
128
|
```typescript
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
// All methods are fully typed
|
|
229
|
-
await feedbackfun.init({ apiKey: '...', projectId: '...' });
|
|
129
|
+
feedbackfun.setPrimaryForeground('#ffffff');
|
|
230
130
|
```
|
|
231
131
|
|
|
232
|
-
## Browser Support
|
|
233
|
-
|
|
234
|
-
- Chrome (last 2 versions)
|
|
235
|
-
- Firefox (last 2 versions)
|
|
236
|
-
- Safari (last 2 versions)
|
|
237
|
-
- Edge (last 2 versions)
|
|
238
|
-
|
|
239
132
|
## License
|
|
240
133
|
|
|
241
134
|
MIT
|