@feedvalue/vue 0.1.1 → 0.1.4

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 +50 -3
  2. package/package.json +17 -17
package/README.md CHANGED
@@ -141,9 +141,52 @@ async function handleSubmit() {
141
141
  </template>
142
142
  ```
143
143
 
144
+ ### Custom Fields
145
+
146
+ 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.**
147
+
148
+ 1. Go to your widget settings in the FeedValue dashboard
149
+ 2. Add custom fields with types: `text`, `email`, or `emoji`
150
+ 3. Use `customFieldValues` when submitting:
151
+
152
+ ```vue
153
+ <script setup>
154
+ import { ref } from 'vue';
155
+ import { useFeedValue } from '@feedvalue/vue';
156
+
157
+ const { submit, isReady } = useFeedValue();
158
+ const name = ref('');
159
+ const category = ref('feature');
160
+
161
+ async function handleSubmit() {
162
+ await submit({
163
+ message: 'Detailed feedback',
164
+ customFieldValues: {
165
+ // Field IDs must match those defined in your widget configuration
166
+ name: name.value,
167
+ category: category.value,
168
+ },
169
+ });
170
+ }
171
+ </script>
172
+
173
+ <template>
174
+ <form @submit.prevent="handleSubmit">
175
+ <input v-model="name" placeholder="Your name" />
176
+ <select v-model="category">
177
+ <option value="bug">Bug Report</option>
178
+ <option value="feature">Feature Request</option>
179
+ </select>
180
+ <button type="submit" :disabled="!isReady">Submit</button>
181
+ </form>
182
+ </template>
183
+ ```
184
+
185
+ > **Important**: The field IDs in `customFieldValues` must match the field IDs defined in your widget configuration on the dashboard.
186
+
144
187
  ### User Identification
145
188
 
146
- User data is automatically included with feedback submissions:
189
+ 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:
147
190
 
148
191
  ```vue
149
192
  <script setup>
@@ -168,6 +211,10 @@ watch(() => props.user, (user) => {
168
211
  </script>
169
212
  ```
170
213
 
214
+ > **User Data vs Custom Fields**
215
+ > - **User data** (`identify`/`setData`): Hidden from users, automatically attached to submissions. Use for internal context like user IDs, subscription plans, etc.
216
+ > - **Custom fields** (`customFieldValues`): Shown as form inputs in the widget. Users fill these in themselves. Must be defined in widget configuration first.
217
+
171
218
  ### Options API Support
172
219
 
173
220
  ```vue
@@ -247,9 +294,9 @@ const instance = inject(FEEDVALUE_KEY);
247
294
  const options = inject(FEEDVALUE_OPTIONS_KEY);
248
295
  ```
249
296
 
250
- ## Nuxt 3 Integration
297
+ ## Nuxt Integration
251
298
 
252
- Create a plugin file:
299
+ Works with Nuxt 3 and Nuxt 4. Create a plugin file:
253
300
 
254
301
  ```typescript
255
302
  // plugins/feedvalue.client.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedvalue/vue",
3
- "version": "0.1.1",
3
+ "version": "0.1.4",
4
4
  "description": "FeedValue Vue 3 SDK - Plugin and Composables for Vue 3+",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -23,30 +23,20 @@
23
23
  "README.md"
24
24
  ],
25
25
  "sideEffects": false,
26
- "scripts": {
27
- "build": "tsup",
28
- "dev": "tsup --watch",
29
- "lint": "eslint src",
30
- "test": "vitest run",
31
- "test:watch": "vitest",
32
- "test:coverage": "vitest run --coverage",
33
- "typecheck": "tsc --noEmit",
34
- "clean": "rm -rf dist"
35
- },
36
26
  "peerDependencies": {
37
27
  "vue": ">=3.3.0"
38
28
  },
39
29
  "dependencies": {
40
- "@feedvalue/core": "workspace:^"
30
+ "@feedvalue/core": "^0.1.4"
41
31
  },
42
32
  "devDependencies": {
43
- "@vitejs/plugin-vue": "^5.2.0",
44
- "@vitest/coverage-v8": "^2.1.0",
33
+ "@vitejs/plugin-vue": "^6.0.3",
34
+ "@vitest/coverage-v8": "^4.0.18",
45
35
  "@vue/test-utils": "^2.4.0",
46
- "happy-dom": "^15.11.0",
36
+ "happy-dom": "^20.3.9",
47
37
  "tsup": "^8.3.0",
48
38
  "typescript": "^5.7.0",
49
- "vitest": "^2.1.0",
39
+ "vitest": "^4.0.18",
50
40
  "vue": "^3.5.0"
51
41
  },
52
42
  "publishConfig": {
@@ -74,5 +64,15 @@
74
64
  ],
75
65
  "engines": {
76
66
  "node": ">=18"
67
+ },
68
+ "scripts": {
69
+ "build": "tsup",
70
+ "dev": "tsup --watch",
71
+ "lint": "eslint src",
72
+ "test": "vitest run",
73
+ "test:watch": "vitest",
74
+ "test:coverage": "vitest run --coverage",
75
+ "typecheck": "tsc --noEmit",
76
+ "clean": "rm -rf dist"
77
77
  }
78
- }
78
+ }