@mhosaic/feedback-cli 0.33.0 → 0.34.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mhosaic/feedback-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "CLI to install @mhosaic/feedback into a host app, verify the integration, and drop a guided Claude Code skill (/integrate-feedback) into ~/.claude/skills.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -17,7 +17,34 @@ VITE_FEEDBACK_ENDPOINT=https://software-factory-3tbbu.ondigitalocean.app
|
|
|
17
17
|
|
|
18
18
|
## Step 2 — Initialize at app boot
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
**Preferred (v0.34+): the first-class Vue plugin.** Error-tracking is on by default; `useFeedback()` works in any `setup()`:
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { createApp } from 'vue'
|
|
24
|
+
import App from './App.vue'
|
|
25
|
+
import { feedbackPlugin } from '@mhosaic/feedback/vue'
|
|
26
|
+
|
|
27
|
+
const app = createApp(App)
|
|
28
|
+
app.use(feedbackPlugin, {
|
|
29
|
+
apiKey: import.meta.env.VITE_FEEDBACK_API_KEY,
|
|
30
|
+
endpoint: import.meta.env.VITE_FEEDBACK_ENDPOINT,
|
|
31
|
+
env: import.meta.env.PROD ? 'prod' : 'dev',
|
|
32
|
+
})
|
|
33
|
+
app.mount('#app')
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Then anywhere in a component:
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { useFeedback } from '@mhosaic/feedback/vue'
|
|
40
|
+
|
|
41
|
+
const fb = useFeedback()
|
|
42
|
+
fb.identify({ id: user.id, email: user.email, name: user.name })
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Note: the Vue plugin uses the **direct bundle** (`@mhosaic/feedback`), not the loader — pin updates arrive via npm bumps. Hosts that want manifest-driven auto-updates instead keep the loader recipe below.
|
|
46
|
+
|
|
47
|
+
**Loader alternative (auto-updating bundle, no plugin):**
|
|
21
48
|
|
|
22
49
|
```typescript
|
|
23
50
|
import { createApp } from 'vue'
|
|
@@ -35,15 +62,12 @@ const fb = withErrorTracking(
|
|
|
35
62
|
)
|
|
36
63
|
|
|
37
64
|
const app = createApp(App)
|
|
38
|
-
// Optional: expose `this.$feedback` in components and `inject('feedback')` in composables
|
|
39
65
|
app.provide('feedback', fb)
|
|
40
66
|
app.mount('#app')
|
|
41
|
-
|
|
42
|
-
// Export for use in other modules (e.g. your auth store)
|
|
43
67
|
export { fb }
|
|
44
68
|
```
|
|
45
69
|
|
|
46
|
-
The widget mounts itself to its own Shadow DOM container outside Vue's root
|
|
70
|
+
The widget mounts itself to its own Shadow DOM container outside Vue's root either way.
|
|
47
71
|
|
|
48
72
|
---
|
|
49
73
|
|