@rbrowton/feedback
v0.1.0
Published
Touchpoint CSAT / NPS / satisfaction micro-surveys for the People Work Life apps
Readme
@rbrowton/feedback
Touchpoint CSAT, satisfaction and NPS micro-surveys. Extracted from Unvarnished's MicroSurvey. The package is storage-agnostic: the host supplies onSubmit and keeps its own table.
Usage
import { MicroSurvey, submitFeedback } from "@rbrowton/feedback";
<MicroSurvey
surveyType="export-pack"
question="How useful was this pack?"
options={[
{ label: "Very useful", value: "very-useful" },
{ label: "Useful", value: "useful" },
{ label: "Not useful", value: "not-useful" },
]}
followUp="Anything we could improve?"
page="/playbooks/runs/…"
contextId={runId}
storageKey={`fb-export-${runId}`}
variant="toast"
onSubmit={(payload) => submitFeedback("/api/feedback", { ...payload, workspaceId })}
/>NPS: set npsScale and skip options. Score maths: npsFromResponses.
Persistence
Copy src/db-templates/prisma.template.prisma or supabase.sql into the host app. Do not import a database client from this package.
Theme
Optional CSS variables: --fb-fg, --fb-muted, --fb-bg, --fb-border, --fb-accent. Falls back to --fg-primary / --border / --brand-500 / --card.
