Small feedback library inspired by https://github.com/ivoviz/feedback Gets screenshot, url, browser info, html, and comments from user.
Filesize minified/compressed: ~6KB (html2canvas not included)
<script
src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"
integrity="sha512-BNaRQnYJYiPSqHHDb58B0yaPfCu+Wgds8Gp/gU33kqBtgNS4tSPHuGibyoeqMV/TJlSKda6FXzoEyYGjTe+vXA=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<script>
var feedback = new Feedback({
onSubmit: function (data) {
// do something
console.log(data);
},
});
feedback.showButton();
// or
// feedback.attach(document.getElementById('my-feedback-btn'));
</script>
Use feedback.showButton
to render a button or attach to your own with feedback.attach
.
onSubmit
Callback that receives feedback data objecthtml2canvas
Pass html2canvas object. Default:window.html2canvas
includeBrowserInfo
: Default: trueincludeUrl
: Default: trueincludeHtml
: Default: true
interface FeedbackData {
browser: Record<string, any>;
html: string;
img: string;
url: string;
note: string;
}
pnpm install
pnpm build
npm i -g http-server
http-server .
MIT