Licence
MIT
Version
0.2.1
Deps
0
Vulns
0
Weekly
0
feedback-sdk-widget
A framework-agnostic feedback button. Renders in Shadow DOM; themeable via CSS custom properties.
Contract (frozen)
- Element:
<feedback-widget> - Attributes:
endpoint(required) -- the service HTTP base, e.g.https://xxx.convex.sitetoken(required) -- the project's public submit token (fbk_...)categories(optional) -- comma-separated; defaultidea,bug,otherpage-context(optional) -- defaultlocation.pathname + location.searchlabel(optional) -- button text; defaultFeedbacksubmitter(optional) -- identity string; omitted means anonymous
- Event:
feedback-submitted,CustomEvent<{ id: string }>, bubbles + composed - Theming: override
--fw-accent,--fw-surface,--fw-surface-strong,--fw-text,--fw-muted,--fw-border,--fw-radius,--fw-z
Usage
npm:
import "feedback-sdk-widget";
// then place <feedback-widget endpoint="..." token="fbk_..."></feedback-widget>
script tag (self-mounts a floating button from data-attrs):
<script src="https://.../feedback-widget.iife.js"
data-endpoint="https://xxx.convex.site"
data-token="fbk_..."></script>
Note: when serving the script from a public CDN, add Subresource Integrity
(integrity="sha384-..." crossorigin="anonymous") using the hash of the built
file.
Build outputs
dist/feedback-widget.js-- ESM, registers the element on importdist/feedback-widget.iife.js-- self-mounting script-tag bundle