1.0.5 • Published 2 years ago
feedback-interview v1.0.5
feedback
⚡ Features
- Easy to integrate with any site
- Customize feedback types and text
🚀 Get started
Via CDN
Add this script to your HTML body tag's end:
<script src="https://cdn.jsdelivr.net/npm/feedback-interview" feedbackEndpoint="https://trendyol-feedback-4e63f-default-rtdb.firebaseio.com/feedbacks.json"></script>
📚 Setup
There are multiple ways to use feedback. The easiest is to include the provided script tag in your HTML file and specify the form endpoint with feedbackEndpoint
:
<script src="https://cdn.jsdelivr.net/npm/feedback-interview" feedbackEndpoint="https://trendyol-feedback-4e63f-default-rtdb.firebaseio.com/feedbacks.json"></script>
If you want to customize feedback further, you can use the feedbackConfig
attribute:
<script src="https://cdn.jsdelivr.net/npm/feedback-interview" feedbackConfig='{ "endpoint": "https://trendyol-feedback-4e63f-default-rtdb.firebaseio.com/feedbacks.json", "id": "example"}'></script>
⚙️ Configuration
You can customize feedback by passing use the feedbackConfig
attribute.
feedbackEndpoint = '{
"id": "trednyolFeedback", // id to identify the form on the backend
"clickToClose": "true", // close the feedback form when clicking outside of it
"title": "Feedback", // text at the top
"modalWidth": "500", // width of the modal
"withCloser": "true", // show the closer button
"buttonTitle": "Send", // title of button
"hiddenButtonAndTitle": "false", // hide the button and title
"endpoint": "https://your-endpoint" // enpoint of your backend to handle the submission
}'
💻 Development
Issues and PRs are very welcome!
The actual source code of this library is in the feedback
file in the src
folder.
- run
npm run build
to produce a production version of feedback in thedist
folder.
❔ About
This library was developed by me (@Ttayfun) for the Trendyol interview.