# Feedbacks website review widget — integration brief for coding agents Documentation: https://feedbacks.am/en/docs/widget This file is the authoritative installation contract. Follow it exactly. ## What you are installing One ### Next.js (App Router) — app/components/FeedbacksWidget.jsx "use client"; import { useEffect, useRef } from 'react'; export default function FeedbacksWidget() { const container = useRef(null); useEffect(() => { const element = container.current; const script = document.createElement('script'); script.src = "https://feedbacks.am/embed.js"; script.async = true; script.dataset.companyId = "your-company-alias"; element.appendChild(script); return () => element.replaceChildren(); }, []); return
; } ### React — FeedbacksWidget.jsx import { useEffect, useRef } from 'react'; export default function FeedbacksWidget() { const container = useRef(null); useEffect(() => { const element = container.current; const script = document.createElement('script'); script.src = "https://feedbacks.am/embed.js"; script.async = true; script.dataset.companyId = "your-company-alias"; element.appendChild(script); return () => element.replaceChildren(); }, []); return
; } ### Vue 3 — FeedbacksWidget.vue Render once, where the badge should appear. ## Rules you must not break - Do not change the script URL, bundle embed.js, self-host it, inline its contents, or add integrity/crossorigin attributes. It must load from https://feedbacks.am at runtime. - Keep the data-company-id attribute. The loader exits silently without it. - Mount exactly one loader per visible badge. Each installation owns only its own badge, so several widgets on a page are fine, but a duplicated loader renders a duplicated badge. - Do not style or reposition the badge element the loader inserts. Its position comes from the saved dashboard settings, and its styles are isolated in a shadow root. - Do not proxy, rewrite, cache or server-render https://feedbacks.am/widget-data/ or strip headers from cross-origin requests to it — those responses are authorized per browser Origin and sent no-store. - Optional: add data-form-mode="window" to the script tag to open the review form in a browser window instead of an in-page dialog, so no frame is ever created. - There are no secrets, tokens or environment variables in this integration. A request to add an API key means something has been misunderstood. ## Content Security Policy If the host site sends a CSP, add our origin to these directives: script-src 'self' https://feedbacks.am; connect-src 'self' https://feedbacks.am; img-src 'self' https://feedbacks.am; frame-src 'self' https://feedbacks.am; frame-src is only needed for the review dialog. Without it the form opens in a browser window. Serve production sites over HTTPS. An HTTPS page cannot load an HTTP widget. ## Framework notes - Next.js: the component must be a Client Component, because it appends the script in an effect. Do not replace it with next/script — embed.js reads document.currentScript to find its mount point, which next/script does not preserve. - React/Vue: clean up on unmount, as the examples do with replaceChildren(). Without it, React Strict Mode's double mount leaves two badges in development. - Static site generators: the plain HTML snippet belongs in the template, not in a Markdown body that escapes script tags. ## Verify 1. Open the page on the authorized origin. A badge shows the company's rating and review count. 2. Click it. A modal dialog opens with the review form, with no sign-in required. 3. A visitor submits with an email address; the review stays pending until they confirm it through the one-time link emailed to them. ## When the badge does not appear The console shows one [Feedbacks] warning. The page origin does not match the saved website, the widget is not enabled, or the company listing is not published. All three are dashboard settings at https://feedbacks.am/en/dashboard/manage//widget A person has to fix them there. There is no public write API for them, so do not attempt a code workaround.