@feedvalue/react 0.1.1 → 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.
Files changed (2) hide show
  1. package/README.md +42 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -153,9 +153,46 @@ export function FeedbackForm() {
153
153
  }
154
154
  ```
155
155
 
156
+ ### Custom Fields
157
+
158
+ Custom fields allow you to collect structured data beyond the main feedback message. **Custom fields must be defined in your widget configuration on the FeedValue dashboard before use.**
159
+
160
+ 1. Go to your widget settings in the FeedValue dashboard
161
+ 2. Add custom fields with types: `text`, `email`, or `emoji`
162
+ 3. Use `customFieldValues` when submitting:
163
+
164
+ ```tsx
165
+ 'use client';
166
+
167
+ import { useFeedValue } from '@feedvalue/react';
168
+
169
+ export function DetailedFeedback() {
170
+ const { submit, isReady } = useFeedValue();
171
+
172
+ const handleSubmit = async () => {
173
+ await submit({
174
+ message: 'Detailed feedback',
175
+ customFieldValues: {
176
+ // Field IDs must match those defined in your widget configuration
177
+ name: 'John Doe',
178
+ category: 'feature',
179
+ },
180
+ });
181
+ };
182
+
183
+ return (
184
+ <button onClick={handleSubmit} disabled={!isReady}>
185
+ Submit Feedback
186
+ </button>
187
+ );
188
+ }
189
+ ```
190
+
191
+ > **Important**: The field IDs in `customFieldValues` must match the field IDs defined in your widget configuration on the dashboard.
192
+
156
193
  ### User Identification
157
194
 
158
- User data is automatically included with feedback submissions:
195
+ Attach user context to feedback submissions. This data is **not shown in the widget UI** but is stored with the submission and visible in your FeedValue dashboard:
159
196
 
160
197
  ```tsx
161
198
  'use client';
@@ -183,6 +220,10 @@ export function UserIdentifier({ user }) {
183
220
  }
184
221
  ```
185
222
 
223
+ > **User Data vs Custom Fields**
224
+ > - **User data** (`identify`/`setData`): Hidden from users, automatically attached to submissions. Use for internal context like user IDs, subscription plans, etc.
225
+ > - **Custom fields** (`customFieldValues`): Shown as form inputs in the widget. Users fill these in themselves. Must be defined in widget configuration first.
226
+
186
227
  ## API Reference
187
228
 
188
229
  ### `<FeedValueProvider>`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedvalue/react",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "FeedValue React SDK - Provider, Hooks, and Components for React 18+",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",