@alliance-droid/status-feedback-system 4.2.3 → 4.3.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/CHANGELOG.md CHANGED
@@ -1,4 +1,18 @@
1
- # Changelog
1
+ # Changelog
2
+
3
+ ## 4.3.0
4
+
5
+ - Security: refreshed dependencies and raised the Svelte peer minimum to 5.55.7. The matching admin update requires feedback-scoped access tokens and explicit project assignments for consumer Admins as well as ProductOwners.
6
+ - Consumer boards now restrict Admins and assigned ProductOwners to accepting, reopening, and declining work. Only acceptance can initiate automation; engineering and release transitions stay in the admin app.
7
+ - Editable items have purple status controls and row accents, with a text cue. The privileged **Needs my input** filter shows Open, Considering, and Waiting on reply across all pages.
8
+ - Board reads forward the optional access token and consume server-authorized item capabilities, including on empty lists. Status changes refresh filtered counts and pagination.
9
+ - Requires the matching `status-feedback-admin` board capabilities update. Deploy the admin server first; custom consumer proxies must forward the optional board `Authorization` header and `status=needs_input` filter.
10
+
11
+ ## 4.2.4
12
+
13
+ ### Fixed
14
+
15
+ - `<FeedbackDetail>` now reloads responses when consumers keep the detail panel mounted and select a different feedback item. The previous item's responses are cleared while the new thread loads, and stale in-flight requests can no longer overwrite the currently selected item's responses.
2
16
 
3
17
  ## 4.2.3
4
18
 
package/README.md CHANGED
@@ -1,55 +1,55 @@
1
- # @alliance-droid/status-feedback-system
2
-
3
- Drop-in system status pages and user feedback components for SvelteKit apps.
4
-
1
+ # @alliance-droid/status-feedback-system
2
+
3
+ Drop-in system status pages and user feedback components for SvelteKit apps.
4
+
5
5
  This package provides UI components plus an optional SvelteKit server proxy for talking to a [status-feedback-admin](https://alliance.ghe.com/alliance/status-feedback-admin) backend. The admin app handles data storage, API key management, and the admin dashboard.
6
-
7
- ## Architecture
8
-
9
- ```
10
- ┌─────────────────────────┐ ┌──────────────────────────┐
11
- │ Your SvelteKit App │ │ status-feedback-admin │
12
- │ │ │ │
13
- │ ┌───────────────────┐ │ API │ ┌────────────────────┐ │
14
- │ │ StatusPage │──┼───────┼──│ /api/status │ │
15
- │ │ FeedbackButton │ │ │ │ /api/feedback │ │
16
- │ │ DevFeedback │ │ │ │ /api/incidents │ │
17
- │ │ Feedback board │ │ │ │ /api/board │ │
18
- │ │ (composable) │ │ │ │ │ │
19
- │ └───────────────────┘ │ │ └────────────────────┘ │
20
- │ │ │ │ │
21
- │ npm package │ │ MSSQL + Azure Blob │
22
- └─────────────────────────┘ └──────────────────────────┘
23
- ```
24
-
25
- ## Setup
26
-
27
- ### 1. Deploy the admin backend
28
-
29
- The admin app ([status-feedback-admin](https://alliance.ghe.com/alliance/status-feedback-admin)) provides the API, database, and admin dashboard. Deploy it first.
30
-
31
- Required env vars on the admin app:
32
- ```bash
33
- MSSQL_CONNECTION_STRING=Server=...;Initial Catalog=StatusFeedback;...
34
- SESSION_SECRET=your-secret
35
-
36
- # Optional — stores screenshots in Azure Blob Storage instead of base64 in DB
37
- AZURE_FEEDBACK_BLOB_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=...
38
- AZURE_FEEDBACK_BLOB_CONTAINER=screenshots
39
- ```
40
-
6
+
7
+ ## Architecture
8
+
9
+ ```
10
+ ┌─────────────────────────┐ ┌──────────────────────────┐
11
+ │ Your SvelteKit App │ │ status-feedback-admin │
12
+ │ │ │ │
13
+ │ ┌───────────────────┐ │ API │ ┌────────────────────┐ │
14
+ │ │ StatusPage │──┼───────┼──│ /api/status │ │
15
+ │ │ FeedbackButton │ │ │ │ /api/feedback │ │
16
+ │ │ DevFeedback │ │ │ │ /api/incidents │ │
17
+ │ │ Feedback board │ │ │ │ /api/board │ │
18
+ │ │ (composable) │ │ │ │ │ │
19
+ │ └───────────────────┘ │ │ └────────────────────┘ │
20
+ │ │ │ │ │
21
+ │ npm package │ │ MSSQL + Azure Blob │
22
+ └─────────────────────────┘ └──────────────────────────┘
23
+ ```
24
+
25
+ ## Setup
26
+
27
+ ### 1. Deploy the admin backend
28
+
29
+ The admin app ([status-feedback-admin](https://alliance.ghe.com/alliance/status-feedback-admin)) provides the API, database, and admin dashboard. Deploy it first.
30
+
31
+ Required env vars on the admin app:
32
+ ```bash
33
+ MSSQL_CONNECTION_STRING=Server=...;Initial Catalog=StatusFeedback;...
34
+ SESSION_SECRET=your-secret
35
+
36
+ # Optional — stores screenshots in Azure Blob Storage instead of base64 in DB
37
+ AZURE_FEEDBACK_BLOB_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=...
38
+ AZURE_FEEDBACK_BLOB_CONTAINER=screenshots
39
+ ```
40
+
41
41
  ### 2. Create a project and keep the API key server-side
42
42
 
43
43
  Log into the admin dashboard, create a project, and copy its API key (prefixed `sf_`). Store it in a private server-side environment variable, not a `PUBLIC_` / browser-delivered variable.
44
-
44
+
45
45
  ### 3. Install the client package
46
46
 
47
47
  ```bash
48
48
  npm install @alliance-droid/status-feedback-system
49
49
  ```
50
-
51
- **Peer dependencies:** `svelte ^5.48.0`, `@alliance-droid/svelte-component-library >=1.3.2`
52
-
50
+
51
+ **Peer dependencies:** `svelte ^5.48.0`, `@alliance-droid/svelte-component-library >=1.3.2`
52
+
53
53
  > `@alliance-droid/svelte-component-library` must be `>=1.3.2` — earlier versions are incompatible with Svelte `5.56+` and throw `target.exclude.has is not a function` when board components render.
54
54
 
55
55
  ### 4. Add the recommended SvelteKit proxy
@@ -81,261 +81,263 @@ Then point components at the same-origin route and omit `apiKey`:
81
81
  ```
82
82
 
83
83
  Direct admin calls with `apiKey="sf_..."` remain supported for existing integrations, but the proxy is the hardened default.
84
-
85
- ## Components
86
-
87
- ### StatusPage
88
-
84
+
85
+ ## Components
86
+
87
+ ### StatusPage
88
+
89
89
  Full status page with systems, incidents, and uptime history bars. Supports **self-fetching** (provide `apiUrl`; add `apiKey` only for direct admin calls) or **pass-through** (provide data directly).
90
-
91
- ```svelte
92
- <script>
93
- import { StatusPage } from '@alliance-droid/status-feedback-system';
94
- </script>
95
-
90
+
91
+ ```svelte
92
+ <script>
93
+ import { StatusPage } from '@alliance-droid/status-feedback-system';
94
+ </script>
95
+
96
96
  <!-- Self-fetching through the same-origin proxy -->
97
97
  <StatusPage
98
98
  projectName="My App"
99
99
  apiUrl="/svc/feedback"
100
100
  />
101
-
102
- <!-- Pass-through mode -->
103
- <StatusPage
104
- projectName="My App"
105
- systems={data.systems}
106
- incidents={data.incidents}
107
- statusHistory={data.statusHistory}
108
- showUptime={true}
109
- />
110
- ```
111
-
112
- | Prop | Type | Default | Description |
113
- |------|------|---------|-------------|
114
- | `projectName` | `string` | required | Display name in the header |
101
+
102
+ <!-- Pass-through mode -->
103
+ <StatusPage
104
+ projectName="My App"
105
+ systems={data.systems}
106
+ incidents={data.incidents}
107
+ statusHistory={data.statusHistory}
108
+ showUptime={true}
109
+ />
110
+ ```
111
+
112
+ | Prop | Type | Default | Description |
113
+ |------|------|---------|-------------|
114
+ | `projectName` | `string` | required | Display name in the header |
115
115
  | `apiUrl` | `string` | — | Proxy URL or direct admin backend URL (self-fetching mode) |
116
116
  | `apiKey` | `string` | — | Project API key; omit when using the same-origin proxy |
117
- | `systems` | `System[]` | — | Pass-through: system data |
118
- | `incidents` | `Incident[]` | — | Pass-through: incident data |
119
- | `statusHistory` | `Record<string, StatusHistoryEntry[]>` | — | Pass-through: uptime data |
120
- | `showUptime` | `boolean` | `true` | Show 90-day uptime bars |
121
-
122
- ### StatusBanner
123
-
124
- Compact inline status indicator — good for footers or nav bars.
125
-
126
- ```svelte
117
+ | `systems` | `System[]` | — | Pass-through: system data |
118
+ | `incidents` | `Incident[]` | — | Pass-through: incident data |
119
+ | `statusHistory` | `Record<string, StatusHistoryEntry[]>` | — | Pass-through: uptime data |
120
+ | `showUptime` | `boolean` | `true` | Show 90-day uptime bars |
121
+
122
+ ### StatusBanner
123
+
124
+ Compact inline status indicator — good for footers or nav bars.
125
+
126
+ ```svelte
127
127
  <StatusBanner
128
128
  apiUrl="/svc/feedback"
129
129
  statusUrl="/status"
130
130
  />
131
- ```
132
-
133
- | Prop | Type | Default | Description |
134
- |------|------|---------|-------------|
135
- | `systems` | `System[]` | — | Pass-through mode |
131
+ ```
132
+
133
+ | Prop | Type | Default | Description |
134
+ |------|------|---------|-------------|
135
+ | `systems` | `System[]` | — | Pass-through mode |
136
136
  | `apiUrl` | `string` | — | Proxy URL or direct admin backend URL |
137
137
  | `apiKey` | `string` | — | Project API key; omit when using the same-origin proxy |
138
- | `statusUrl` | `string` | — | Links to full status page (renders as `<a>`) |
139
-
140
- ### FeedbackButton
141
-
142
- Floating action button with an embedded feedback form. Fixed position, bottom corner.
143
-
144
- ```svelte
138
+ | `statusUrl` | `string` | — | Links to full status page (renders as `<a>`) |
139
+
140
+ ### FeedbackButton
141
+
142
+ Floating action button with an embedded feedback form. Fixed position, bottom corner.
143
+
144
+ ```svelte
145
145
  <FeedbackButton
146
146
  apiUrl="/svc/feedback"
147
147
  position="bottom-right"
148
148
  categories={['Bug', 'Feature Request', 'General']}
149
149
  userEmail={currentUser?.email}
150
- />
151
- ```
152
-
153
- | Prop | Type | Default | Description |
154
- |------|------|---------|-------------|
150
+ />
151
+ ```
152
+
153
+ | Prop | Type | Default | Description |
154
+ |------|------|---------|-------------|
155
155
  | `apiUrl` | `string` | required | Proxy URL or direct admin backend URL |
156
156
  | `apiKey` | `string` | — | Project API key; omit when using the same-origin proxy |
157
- | `categories` | `string[]` | `['Bug', 'Feature Request', 'General']` | Category options |
158
- | `userEmail` | `string` | — | Pre-fill email field |
159
- | `position` | `'bottom-right' \| 'bottom-left'` | `'bottom-right'` | Button position |
160
-
161
- ### FeedbackForm
162
-
163
- Standalone feedback form — embed it wherever you need it.
164
-
165
- ```svelte
157
+ | `categories` | `string[]` | `['Bug', 'Feature Request', 'General']` | Category options |
158
+ | `userEmail` | `string` | — | Pre-fill email field |
159
+ | `position` | `'bottom-right' \| 'bottom-left'` | `'bottom-right'` | Button position |
160
+
161
+ ### FeedbackForm
162
+
163
+ Standalone feedback form — embed it wherever you need it.
164
+
165
+ ```svelte
166
166
  <FeedbackForm
167
167
  apiUrl="/svc/feedback"
168
168
  categories={['Bug', 'Feature Request']}
169
169
  userEmail={currentUser?.email}
170
- onSuccess={() => toast('Thanks!')}
171
- onError={(msg) => toast(msg, 'error')}
172
- />
173
- ```
174
-
175
- | Prop | Type | Default | Description |
176
- |------|------|---------|-------------|
170
+ onSuccess={() => toast('Thanks!')}
171
+ onError={(msg) => toast(msg, 'error')}
172
+ />
173
+ ```
174
+
175
+ | Prop | Type | Default | Description |
176
+ |------|------|---------|-------------|
177
177
  | `apiUrl` | `string` | required | Proxy URL or direct admin backend URL |
178
178
  | `apiKey` | `string` | — | Project API key; omit when using the same-origin proxy |
179
- | `categories` | `string[]` | `['Bug', 'Feature Request', 'General']` | Category options |
180
- | `userEmail` | `string` | — | Pre-fill email field |
181
- | `onSuccess` | `() => void` | — | Called after successful submission |
182
- | `onError` | `(error: string) => void` | — | Called on submission error |
183
-
184
- ### Feedback board (composable)
185
-
186
- > 📖 **Full integration guide:** [docs/custom-feedback-integration.md](docs/custom-feedback-integration.md) — composing the parts into your own shell, status management via `getAuthToken`, list restyling, and the not-configured fallback.
187
-
188
- The board is composed from parts around **one shared state** (`createFeedbackBoard`), so it drops into your own layout/shell — app rails, breadcrumb, a right-hand detail panel, whatever you have.
189
-
190
- ```svelte
191
- <script lang="ts">
192
- import {
193
- createFeedbackBoard,
194
- createAuthTokenGetter,
195
- FeedbackSidebar,
196
- FeedbackList,
197
- FeedbackDetail,
198
- FeedbackSubmitForm,
199
- type BoardItem,
200
- } from '@alliance-droid/status-feedback-system';
201
-
179
+ | `categories` | `string[]` | `['Bug', 'Feature Request', 'General']` | Category options |
180
+ | `userEmail` | `string` | — | Pre-fill email field |
181
+ | `onSuccess` | `() => void` | — | Called after successful submission |
182
+ | `onError` | `(error: string) => void` | — | Called on submission error |
183
+
184
+ ### Feedback board (composable)
185
+
186
+ > 📖 **Full integration guide:** [docs/custom-feedback-integration.md](docs/custom-feedback-integration.md) — composing the parts into your own shell, status management via `getAuthToken`, list restyling, and the not-configured fallback.
187
+
188
+ The board is composed from parts around **one shared state** (`createFeedbackBoard`), so it drops into your own layout/shell — app rails, breadcrumb, a right-hand detail panel, whatever you have.
189
+
190
+ ```svelte
191
+ <script lang="ts">
192
+ import {
193
+ createFeedbackBoard,
194
+ createAuthTokenGetter,
195
+ FeedbackSidebar,
196
+ FeedbackList,
197
+ FeedbackDetail,
198
+ FeedbackSubmitForm,
199
+ type BoardItem,
200
+ } from '@alliance-droid/status-feedback-system';
201
+
202
202
  let { data } = $props();
203
203
  const board = createFeedbackBoard({
204
204
  apiUrl: '/svc/feedback',
205
205
  userEmail: data.user?.email,
206
206
  getAuthToken: createAuthTokenGetter(), // optional — enables status management
207
- categoryConfig: {
208
- Bug: { icon: 'fa-solid fa-bug', label: 'Bugs' },
209
- 'Feature Request': { icon: 'fa-solid fa-lightbulb', label: 'Ideas' },
210
- },
211
- });
212
-
213
- let selected = $state<BoardItem | null>(null);
214
- </script>
215
-
216
- <YourSidebar><FeedbackSidebar {board} /></YourSidebar>
217
- <YourMain><FeedbackList {board} onSelect={(i) => (selected = i)} /></YourMain>
218
- <YourRail>
219
- {#if selected}<FeedbackDetail {board} item={selected} />{/if}
220
- </YourRail>
221
- <!-- Render <FeedbackSubmitForm {board} /> wherever you want submission. -->
222
- ```
223
-
224
- `createFeedbackBoard(options)` returns a reactive `FeedbackBoardState` (items, categories, filters, voting, `loadTransitions`/`setStatus`, …) shared by every sub-component.
225
-
226
- | Option | Type | Default | Description |
227
- |--------|------|---------|-------------|
207
+ categoryConfig: {
208
+ Bug: { icon: 'fa-solid fa-bug', label: 'Bugs' },
209
+ 'Feature Request': { icon: 'fa-solid fa-lightbulb', label: 'Ideas' },
210
+ },
211
+ });
212
+
213
+ let selected = $state<BoardItem | null>(null);
214
+ </script>
215
+
216
+ <YourSidebar><FeedbackSidebar {board} /></YourSidebar>
217
+ <YourMain><FeedbackList {board} onSelect={(i) => (selected = i)} /></YourMain>
218
+ <YourRail>
219
+ {#if selected}<FeedbackDetail {board} item={selected} />{/if}
220
+ </YourRail>
221
+ <!-- Render <FeedbackSubmitForm {board} /> wherever you want submission. -->
222
+ ```
223
+
224
+ `createFeedbackBoard(options)` returns a reactive `FeedbackBoardState` (items, categories, filters, voting, `loadTransitions`/`setStatus`, …) shared by every sub-component.
225
+
226
+ | Option | Type | Default | Description |
227
+ |--------|------|---------|-------------|
228
228
  | `apiUrl` | `string` | required | Proxy URL or direct admin backend URL |
229
229
  | `apiKey` | `string` | — | Project API key; omit when using the same-origin proxy |
230
- | `userEmail` | `string` | — | Authenticated user (required to submit feedback/replies) |
231
- | `categoryConfig` | `Record<string, { label?, icon?, description? }>` | `{}` | Relabel / add icons to sidebar categories |
232
- | `getAuthToken` | `() => string \| Promise<string \| null>` | — | Bearer token so privileged users can set status (see below) |
233
- | `pageSize` | `number` | `50` | Items per page |
234
-
235
- Exported parts: `createFeedbackBoard`, `FeedbackSidebar`, `FeedbackList`, `FeedbackItem`, `FeedbackDetail`, `FeedbackSubmitForm`.
236
-
237
- Categories are fixed by the system (**Bug**, **Feature Request**) — `categoryConfig` only relabels or adds icons.
238
-
239
- #### Setting status (ProductOwner)
240
-
241
- When you pass `getAuthToken`, a signed-in **ProductOwner** with access to the project can change an item's status from the board (via the status badge → menu) — e.g. Open → Considering → Accepted, or a decline with a reason — without a trip to the admin dashboard. Board status management is **ProductOwner-only**; an Admin role alone does not grant it (Admins still manage status from the dashboard).
242
-
243
- Privileged viewers also see each item's **real internal status** on the badge (e.g. "QA / UAT", "Technical review") rather than the coarse public bucket ("In progress") that everyone else sees.
244
-
245
- - `getAuthToken` must return the user's **Alliance OIDC access token** whose audience covers **`status-feedback-admin`** (an *id token*, whose `aud` is your app's client id, is rejected). It's called on demand; return `null` for anonymous / non-privileged users and the control simply won't appear — the badge stays a plain read-only badge.
246
- - **Use the built-in `createAuthTokenGetter()`** for this — it fetches a same-origin token endpoint (`/auth/access-token` by default), caches until just before expiry, single-flights, and returns `null` on any failure. With `@alliance-droid/svelte-auth-core`, set `enableAccessTokenEndpoint: true` and request the `status-feedback-admin` scope so that endpoint exists. Create one instance at module level: `export const getAuthToken = createAuthTokenGetter();`
247
- - The token travels as `Authorization: Bearer …` to the admin backend, which **verifies it against the IdP** and derives the user's roles. Authorization (ProductOwner role + per-project access + which transitions are allowed, including reason prompts on declines/reopens) is enforced **server-side** — the client never decides permissions. The backend returns a `canManage` flag (HTTP 200, not 403) so ordinary signed-in users get no console noise.
248
- - The available transitions are returned by the backend per item, so the menu always reflects exactly what that user may do.
249
-
230
+ | `userEmail` | `string` | — | Authenticated user (required to submit feedback/replies) |
231
+ | `categoryConfig` | `Record<string, { label?, icon?, description? }>` | `{}` | Relabel / add icons to sidebar categories |
232
+ | `getAuthToken` | `() => string \| Promise<string \| null>` | — | Bearer token so privileged users can set status (see below) |
233
+ | `pageSize` | `number` | `50` | Items per page |
234
+
235
+ Exported parts: `createFeedbackBoard`, `FeedbackSidebar`, `FeedbackList`, `FeedbackItem`, `FeedbackDetail`, `FeedbackSubmitForm`.
236
+
237
+ Categories are fixed by the system (**Bug**, **Feature Request**) — `categoryConfig` only relabels or adds icons.
238
+
239
+ #### Setting status (ProductOwners and Admins)
240
+
241
+ When you pass `getAuthToken`, **Admins** and **ProductOwners with project access** can accept, reopen, or decline feedback (Won't do, Duplicate, Can't reproduce), where the current status permits the decision. Reopens and declines require a reason. **Only acceptance starts automation**; engineering, QA approval, release, and completion transitions remain in the admin app.
242
+
243
+ Editable items have **purple status controls and row accents**, accompanied by a text cue. The sidebar's **Needs my input** filter shows Open, Considering, and Waiting on reply, filtered on the server across all pages. Everyone continues to see each item's granular status.
244
+
245
+ Deploy the matching admin-server capabilities update first. The packaged proxy forwards the optional board bearer token; custom proxies must also forward `Authorization` on board reads and preserve `status=needs_input`. Custom lists can use the backend's per-item `canChangeStatus` and `needsInput` fields with `board.canManageStatus`.
246
+
247
+ - `getAuthToken` must return the user's **Alliance OIDC access token** whose audience covers **`status-feedback-admin`** (an *id token*, whose `aud` is your app's client id, is rejected). It's called on demand; return `null` for anonymous / non-privileged users and the control simply won't appear — the badge stays a plain read-only badge.
248
+ - **Use the built-in `createAuthTokenGetter()`** for this — it fetches a same-origin token endpoint (`/auth/access-token` by default), caches until just before expiry, single-flights, and returns `null` on any failure. With `@alliance-droid/svelte-auth-core`, set `enableAccessTokenEndpoint: true` and request the `status-feedback-admin` scope so that endpoint exists. Create one instance at module level: `export const getAuthToken = createAuthTokenGetter();`
249
+ - The token travels as `Authorization: Bearer …` to the admin backend, which **verifies it against the IdP** and derives the user's roles. Authorization (Admin or ProductOwner role + per-project access + the restricted board transitions, including reason prompts on declines/reopens) is enforced **server-side** — the client never decides permissions. The backend returns a `canManage` flag (HTTP 200, not 403) so ordinary signed-in users get no console noise.
250
+ - The available transitions are returned by the backend per item, so the menu always reflects exactly what that user may do.
251
+
250
252
  > Security note: use the SvelteKit proxy to keep the project `apiKey` out of browser-delivered code. Direct admin calls with an embedded key are still supported for existing integrations, but same-origin proxy mode is the recommended default.
251
-
252
- ### DevFeedback
253
-
254
- Feedback overlay for authorized users. Activated via **Ctrl+right-click** (Cmd+right-click on macOS) anywhere on the page.
255
-
256
- Auto-captures: screenshots (via html2canvas), console errors, viewport size, current route, clicked element selector, and deployment context (Vercel env vars).
257
-
258
- **Gating:** the widget shows only when `enabled` is `true` **and** `userEmail` is non-empty. `enabled` is the single gate — wire it to your own rule, typically a role/permission check. There is no environment auto-detection. See [docs/role-based-access.md](docs/role-based-access.md) for the recommended role-based setup and the pitfalls.
259
-
260
- ```svelte
261
- <script>
262
- import { DevFeedback } from '@alliance-droid/status-feedback-system';
263
- </script>
264
-
265
- <!-- In your root +layout.svelte -->
253
+
254
+ ### DevFeedback
255
+
256
+ Feedback overlay for authorized users. Activated via **Ctrl+right-click** (Cmd+right-click on macOS) anywhere on the page.
257
+
258
+ Auto-captures: screenshots (via html2canvas), console errors, viewport size, current route, clicked element selector, and deployment context (Vercel env vars).
259
+
260
+ **Gating:** the widget shows only when `enabled` is `true` **and** `userEmail` is non-empty. `enabled` is the single gate — wire it to your own rule, typically a role/permission check. There is no environment auto-detection. See [docs/role-based-access.md](docs/role-based-access.md) for the recommended role-based setup and the pitfalls.
261
+
262
+ ```svelte
263
+ <script>
264
+ import { DevFeedback } from '@alliance-droid/status-feedback-system';
265
+ </script>
266
+
267
+ <!-- In your root +layout.svelte -->
266
268
  <DevFeedback
267
269
  apiUrl="/svc/feedback/dev"
268
270
  boardUrl="/feedback"
269
271
  userEmail={user?.email ?? ''}
270
272
  enabled={userCanGiveFeedback}
271
- />
272
- ```
273
-
274
- | Prop | Type | Default | Description |
275
- |------|------|---------|-------------|
273
+ />
274
+ ```
275
+
276
+ | Prop | Type | Default | Description |
277
+ |------|------|---------|-------------|
276
278
  | `apiUrl` | `string` | required | Proxy URL or direct admin backend URL. Use `/svc/feedback/dev` with the package proxy for stricter widget policy. |
277
279
  | `apiKey` | `string` | — | Project API key; omit when using the same-origin proxy |
278
- | `enabled` | `boolean` | required | The only gate — wire to your role/permission check |
279
- | `userEmail` | `string` | required | Signed-in user's email. Empty string ⇒ renders nothing (anonymous feedback unsupported) |
280
- | `boardUrl` | `string` | — | URL for "View Open Issues" link. Hidden if omitted. |
281
- | `maxConsoleErrors` | `number` | `20` | Max console errors to capture |
282
- | `showOnboarding` | `boolean` | `true` | Show "Ctrl+right-click" toast on first visit |
283
- | `renderTokenEndpoint` | `string` | `/svc/internal/issue-render-token` | App endpoint that mints render tokens for screenshot capture |
284
-
285
- **Screenshot storage:** If the admin backend has `AZURE_FEEDBACK_BLOB_CONNECTION_STRING` configured, screenshots are uploaded to Azure Blob Storage. Otherwise they're stored as base64 in the database.
286
-
287
- ## API Client
288
-
289
- All components use a shared API client. You can also use it directly:
290
-
291
- ```typescript
292
- import { createStatusClient } from '@alliance-droid/status-feedback-system';
293
-
280
+ | `enabled` | `boolean` | required | The only gate — wire to your role/permission check |
281
+ | `userEmail` | `string` | required | Signed-in user's email. Empty string ⇒ renders nothing (anonymous feedback unsupported) |
282
+ | `boardUrl` | `string` | — | URL for "View Open Issues" link. Hidden if omitted. |
283
+ | `maxConsoleErrors` | `number` | `20` | Max console errors to capture |
284
+ | `showOnboarding` | `boolean` | `true` | Show "Ctrl+right-click" toast on first visit |
285
+ | `renderTokenEndpoint` | `string` | `/svc/internal/issue-render-token` | App endpoint that mints render tokens for screenshot capture |
286
+
287
+ **Screenshot storage:** If the admin backend has `AZURE_FEEDBACK_BLOB_CONNECTION_STRING` configured, screenshots are uploaded to Azure Blob Storage. Otherwise they're stored as base64 in the database.
288
+
289
+ ## API Client
290
+
291
+ All components use a shared API client. You can also use it directly:
292
+
293
+ ```typescript
294
+ import { createStatusClient } from '@alliance-droid/status-feedback-system';
295
+
294
296
  const client = createStatusClient({
295
297
  apiUrl: '/svc/feedback',
296
298
  fetch: event.fetch, // Optional: pass SvelteKit's fetch for SSR
297
299
  });
298
-
299
- const { systems, overallStatus } = await client.getStatus();
300
- const { incidents } = await client.getIncidents({ limit: 5, includeResolved: true });
301
- const { history } = await client.getUptime({ days: 90 });
302
- const feedback = await client.submitFeedback({ message: 'Great product!' });
303
- const { items, total, categories } = await client.getBoard({ sort: 'votes', status: 'open' });
304
- ```
305
-
306
- ## Shared Components
307
-
308
- Lower-level building blocks used by StatusPage — exported for custom layouts:
309
-
310
- ```typescript
311
- import {
312
- StatusIndicator, // Status dot + label (operational/degraded/outage/maintenance)
313
- UptimeBar, // 90-day uptime bar chart
314
- IncidentTimeline, // Chronological incident updates
315
- SystemCard, // Single system status card with uptime bar
316
- } from '@alliance-droid/status-feedback-system';
317
- ```
318
-
319
- ## All Exports
320
-
321
- ```typescript
322
- // Components
323
- import {
324
- StatusPage, StatusBanner, FeedbackForm, FeedbackButton, DevFeedback,
325
- StatusIndicator, UptimeBar, IncidentTimeline, SystemCard, PasteImageInput,
326
- } from '@alliance-droid/status-feedback-system';
327
-
328
- // Feedback board (composable)
329
- import {
330
- createFeedbackBoard,
331
- createAuthTokenGetter,
332
- FeedbackSidebar, FeedbackList, FeedbackItem, FeedbackDetail, FeedbackSubmitForm,
333
- } from '@alliance-droid/status-feedback-system';
334
- import type {
335
- FeedbackBoardState, FeedbackBoardOptions, CategoryConfig,
336
- AuthTokenGetter, AuthTokenGetterOptions,
337
- } from '@alliance-droid/status-feedback-system';
338
-
300
+
301
+ const { systems, overallStatus } = await client.getStatus();
302
+ const { incidents } = await client.getIncidents({ limit: 5, includeResolved: true });
303
+ const { history } = await client.getUptime({ days: 90 });
304
+ const feedback = await client.submitFeedback({ message: 'Great product!' });
305
+ const { items, total, categories } = await client.getBoard({ sort: 'votes', status: 'open' });
306
+ ```
307
+
308
+ ## Shared Components
309
+
310
+ Lower-level building blocks used by StatusPage — exported for custom layouts:
311
+
312
+ ```typescript
313
+ import {
314
+ StatusIndicator, // Status dot + label (operational/degraded/outage/maintenance)
315
+ UptimeBar, // 90-day uptime bar chart
316
+ IncidentTimeline, // Chronological incident updates
317
+ SystemCard, // Single system status card with uptime bar
318
+ } from '@alliance-droid/status-feedback-system';
319
+ ```
320
+
321
+ ## All Exports
322
+
323
+ ```typescript
324
+ // Components
325
+ import {
326
+ StatusPage, StatusBanner, FeedbackForm, FeedbackButton, DevFeedback,
327
+ StatusIndicator, UptimeBar, IncidentTimeline, SystemCard, PasteImageInput,
328
+ } from '@alliance-droid/status-feedback-system';
329
+
330
+ // Feedback board (composable)
331
+ import {
332
+ createFeedbackBoard,
333
+ createAuthTokenGetter,
334
+ FeedbackSidebar, FeedbackList, FeedbackItem, FeedbackDetail, FeedbackSubmitForm,
335
+ } from '@alliance-droid/status-feedback-system';
336
+ import type {
337
+ FeedbackBoardState, FeedbackBoardOptions, CategoryConfig,
338
+ AuthTokenGetter, AuthTokenGetterOptions,
339
+ } from '@alliance-droid/status-feedback-system';
340
+
339
341
  // API Client
340
342
  import { createStatusClient } from '@alliance-droid/status-feedback-system';
341
343
  import type {
@@ -351,15 +353,15 @@ import {
351
353
 
352
354
  // Utilities
353
355
  import { deriveOverallStatus } from '@alliance-droid/status-feedback-system';
354
-
355
- // Types
356
- import type {
357
- Project, System, Incident, IncidentUpdate, Feedback, FeedbackResponse,
358
- FeedbackVisibility, StatusHistoryEntry, ApiResponse,
359
- SystemStatus, IncidentStatus, IncidentSeverity, FeedbackStatus,
360
- } from '@alliance-droid/status-feedback-system';
361
- ```
362
-
363
- ## License
364
-
365
- Copyright © 2026 Alliance Technical Group. All rights reserved.
356
+
357
+ // Types
358
+ import type {
359
+ Project, System, Incident, IncidentUpdate, Feedback, FeedbackResponse,
360
+ FeedbackVisibility, StatusHistoryEntry, ApiResponse,
361
+ SystemStatus, IncidentStatus, IncidentSeverity, FeedbackStatus,
362
+ } from '@alliance-droid/status-feedback-system';
363
+ ```
364
+
365
+ ## License
366
+
367
+ Copyright © 2026 Alliance Technical Group. All rights reserved.