@rensblitz/customer-instant-feedback-app 2.0.5 → 3.0.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 +24 -9
- package/dist/customer-instant-feedback.js +2553 -2900
- package/dist/customer-instant-feedback.umd.cjs +32 -104
- package/dist/feedback/FeedbackReviewPage.d.ts +1 -0
- package/dist/feedback/supabaseClient.d.ts +0 -2
- package/dist/index.d.ts +1 -2
- package/dist/style.css +1 -1
- package/package.json +6 -8
- package/dist/feedback/FeedbackAdminPage.d.ts +0 -1
package/README.md
CHANGED
|
@@ -2,13 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
A React component library for collecting user feedback directly within your application. Uses a centralized Supabase backend with reviewer-based authentication.
|
|
4
4
|
|
|
5
|
+
## Repository layout (this monorepo)
|
|
6
|
+
|
|
7
|
+
- **`packages/customer-instant-feedback-app`** — the publishable npm package (`npm run build`, `npm publish -w @rensblitz/customer-instant-feedback-app`).
|
|
8
|
+
- **`apps/demo`** — local consumer app (workspace `file:` link).
|
|
9
|
+
- **`apps/demo-npm`** — same idea, but depends on the **published** package from npm (see `apps/demo-npm/README.md`).
|
|
10
|
+
- **`apps/feedback-admin-app`** — standalone admin UI (deploy from repo root; see [`render.yaml`](./render.yaml)).
|
|
11
|
+
|
|
5
12
|
## Features
|
|
6
13
|
|
|
7
14
|
- Capture screenshots with feedback
|
|
8
15
|
- Annotate specific elements
|
|
9
16
|
- Categorize feedback (Bug, UX, Content, Other)
|
|
10
17
|
- Reviewer-based authentication (no anonymous feedback)
|
|
11
|
-
- Admin UI
|
|
18
|
+
- Admin UI is a **standalone app** in [`apps/feedback-admin-app/`](./apps/feedback-admin-app/) (not exported from the npm package in v3+)
|
|
12
19
|
- Feedback review page for reviewers to see all feedback (including from colleagues)
|
|
13
20
|
- Client-side rate limiting
|
|
14
21
|
- Input validation
|
|
@@ -35,8 +42,15 @@ pnpm add @rensblitz/customer-instant-feedback-app @supabase/supabase-js react re
|
|
|
35
42
|
|
|
36
43
|
> **Note:** React, React DOM, React Router, and Supabase are peer dependencies. If your project already has them, you only need to install the feedback package.
|
|
37
44
|
|
|
45
|
+
### Upgrading from 2.x to 3.x
|
|
46
|
+
|
|
47
|
+
- **`FeedbackAdminPage` was removed** from the package. Remove any import and route; use the standalone [`apps/feedback-admin-app`](./apps/feedback-admin-app/) (or deploy it separately).
|
|
48
|
+
- **`getSupabaseClient`** is now exported if you need direct Supabase access in advanced integrations.
|
|
49
|
+
|
|
38
50
|
## Quick Start
|
|
39
51
|
|
|
52
|
+
**Host app integration (typical):** install the package, add Supabase URL + anon key to `.env`, wrap the app with `FeedbackAuthProvider` / `FeedbackProvider`, and pass the `project_id` string from your operator. You do **not** need to run database migrations in your repo—that happens on the Supabase project (see below if you operate that backend). The in-app setup page at `/readme` (`FeedbackReadmePage`) describes only this flow; full operator steps stay in this README.
|
|
53
|
+
|
|
40
54
|
### 1. Environment variables (host project)
|
|
41
55
|
|
|
42
56
|
Add these to your **host project's** `.env` file (not this package):
|
|
@@ -100,7 +114,6 @@ import {
|
|
|
100
114
|
FeedbackAuthProvider,
|
|
101
115
|
FeedbackProvider,
|
|
102
116
|
FeedbackLoginPage,
|
|
103
|
-
FeedbackAdminPage,
|
|
104
117
|
FeedbackReviewPage,
|
|
105
118
|
} from '@rensblitz/customer-instant-feedback-app';
|
|
106
119
|
import '@rensblitz/customer-instant-feedback-app/style.css';
|
|
@@ -114,7 +127,6 @@ function App() {
|
|
|
114
127
|
<BrowserRouter>
|
|
115
128
|
<Routes>
|
|
116
129
|
<Route path="/feedback-login" element={<FeedbackLoginPage />} />
|
|
117
|
-
<Route path="/feedback-admin" element={<FeedbackAdminPage />} />
|
|
118
130
|
<Route path="/feedback" element={<FeedbackReviewPage projectId={projectId} />} />
|
|
119
131
|
<Route
|
|
120
132
|
path="/*"
|
|
@@ -131,11 +143,13 @@ function App() {
|
|
|
131
143
|
}
|
|
132
144
|
```
|
|
133
145
|
|
|
146
|
+
**Admin UI** (companies, projects, reviewers) is **not** part of the npm package. Run the standalone app in [`apps/feedback-admin-app/`](./apps/feedback-admin-app/) (see its README) or deploy it separately (e.g. Render).
|
|
147
|
+
|
|
134
148
|
**Important:** Always import the CSS file. Without it, the feedback modal has no styles.
|
|
135
149
|
|
|
136
150
|
### 5. Get your project ID
|
|
137
151
|
|
|
138
|
-
|
|
152
|
+
Use the **Feedback Admin** standalone app (in `apps/feedback-admin-app/` in this repo) to create a company and project, then copy the `project_id` (format: `short-code_uuid`) and pass it to `FeedbackProvider` and `FeedbackReviewPage`.
|
|
139
153
|
|
|
140
154
|
### 6. Create the first admin
|
|
141
155
|
|
|
@@ -146,7 +160,7 @@ Go to `/feedback-admin`, create a company and project, then copy the `project_id
|
|
|
146
160
|
## How it works
|
|
147
161
|
|
|
148
162
|
- **Reviewers** visit `/feedback-login` to sign in with credentials provided by an admin. Only logged-in reviewers can see and use the feedback widget. They can visit `/feedback` to see all feedback for the project (including from colleagues).
|
|
149
|
-
- **Admins**
|
|
163
|
+
- **Admins** use the standalone **Feedback Admin** app (`apps/feedback-admin-app/` in this repository, or your deployed instance) to manage companies, projects, and reviewers. Only users in the `admins` table can access it.
|
|
150
164
|
- **Feedback** is stored in the centralized Supabase project, scoped by project. Each host app passes its `projectId` to identify which project the feedback belongs to.
|
|
151
165
|
|
|
152
166
|
## Usage
|
|
@@ -235,7 +249,7 @@ interface FeedbackReviewPageProps {
|
|
|
235
249
|
|
|
236
250
|
### Testing the library locally
|
|
237
251
|
|
|
238
|
-
The `demo/` folder contains a separate app that imports the library like a real consumer would:
|
|
252
|
+
The `apps/demo/` folder contains a separate app that imports the library like a real consumer would:
|
|
239
253
|
|
|
240
254
|
1. **First time setup:**
|
|
241
255
|
```bash
|
|
@@ -243,7 +257,7 @@ The `demo/` folder contains a separate app that imports the library like a real
|
|
|
243
257
|
npm link
|
|
244
258
|
cd demo && npm link @rensblitz/customer-instant-feedback-app
|
|
245
259
|
```
|
|
246
|
-
Add `VITE_FEEDBACK_SUPABASE_URL` and `VITE_FEEDBACK_SUPABASE_ANON_KEY` to `demo/.env` (copy from `demo/.env.example` if present).
|
|
260
|
+
Add `VITE_FEEDBACK_SUPABASE_URL` and `VITE_FEEDBACK_SUPABASE_ANON_KEY` to `apps/demo/.env` (copy from `apps/demo/.env.example` if present).
|
|
247
261
|
|
|
248
262
|
2. **Build the library:**
|
|
249
263
|
```bash
|
|
@@ -261,13 +275,14 @@ The demo app imports from `node_modules` using `npm link`, so it works exactly l
|
|
|
261
275
|
- Rebuild: `npm run build`
|
|
262
276
|
- The demo will hot-reload automatically
|
|
263
277
|
|
|
264
|
-
**Demo includes
|
|
265
|
-
- `/feedback-admin` - Admin interface for managing companies, projects, and reviewers
|
|
278
|
+
**Demo includes** (typical host routes; see `apps/demo/`):
|
|
266
279
|
- `/feedback-login` - Login page for reviewers
|
|
267
280
|
- `/feedback` - Feedback review page
|
|
268
281
|
- `/readme` - Setup guide (also available as `FeedbackReadmePage` for host apps)
|
|
269
282
|
- `/` - Demo page with the feedback widget
|
|
270
283
|
|
|
284
|
+
**Admin** is a separate Vite app: run `npm run admin:dev` from the repo root (see [`apps/feedback-admin-app/README.md`](./apps/feedback-admin-app/README.md)).
|
|
285
|
+
|
|
271
286
|
### Building for npm
|
|
272
287
|
|
|
273
288
|
```bash
|