Skip to content

Commit 480a431

Browse files
chore: update documentation
1 parent 3b0e989 commit 480a431

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

elements/feedback/src/main.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,27 @@ import { styleEOX } from "./style.eox";
44
import "./feedback-button.js";
55

66
/**
7-
* The `eox-feedback` element provides a modal dialog for collecting user feedback. It supports screenshot capture, customizable endpoint, and flexible styling.
8-
* The feedback modal (`<eox-feedback></eox-feedback>`) can be included in the DOM directly or via a floating button (`<eox-feedback-button></eox-feedback-button>`), which can be positioned in any corner of the viewport.
7+
* The `eox-feedback` element provides a modal dialog for collecting user feedback.
8+
* It supports screenshot capture, customizable endpoint, and flexible styling.
9+
* The feedback modal (`<eox-feedback></eox-feedback>`) can be included in the DOM
10+
* directly or via a floating button (`<eox-feedback-button></eox-feedback-button>`),
11+
* which can be positioned in any corner of the viewport.
12+
*
13+
* On submit, the element sends a `POST` request with `FormData` to the configured
14+
* `endpoint`. The payload includes the feedback message (or custom form fields when
15+
* using a `schema`), the current page URL, the browser's user agent, and optionally
16+
* a screenshot file. This makes it straightforward to connect to any backend — for
17+
* example a service that creates issues in a Git platform (GitLab, GitHub, …), sends
18+
* notifications, or stores feedback in a database.
19+
*
20+
* The backend only needs to accept a `multipart/form-data` POST request, extract the
21+
* fields and the optional file attachment, and then forward them to whatever system
22+
* you use for tracking or processing feedback. Because all authentication and API
23+
* tokens live on the server side, the browser never sees sensitive credentials.
24+
* Typical backend responsibilities include input sanitization, CORS configuration to
25+
* restrict which origins may submit feedback, and mapping the received fields into the
26+
* format expected by the target system (e.g. composing an issue title and body, or
27+
* building an email).
928
*
1029
* @element eox-feedback
1130
*

0 commit comments

Comments
 (0)