Feedback Widget

The feedback widget lets people on your team point at parts of your website and ask Amp to change them. You add one script tag to the site. Then you open the site with ?amp, connect to Amp, select elements on the page, and write a comment for each one. When you send the comments, Amp starts a thread in your project, and the agent makes the change in an orb.

The widget works in workspace projects and in personal projects. In a personal project, only you can send comments. See Permissions.

For an app on a box, you need no script tag: deploy it with amp boxes deploy --widget. See Feedback Widget on the Boxes page.

Set Up the Widget

You need permission to change the project’s settings. See Permissions.

  1. Open the project settings and choose the Feedback Widget tab.
  2. Read the Widget Security notice. See Site Security.
  3. Click Enable. Amp creates a widget key for the project, and the tab shows a Script Tag.
  4. Copy the script tag and add it to the HTML of your site, e.g., in the <head> of every page. Then deploy the site.
  5. Under Allowed Origins, enter the address of your site and click Add Origin.

The script tag looks like this. The part after /w/ is the widget key:

<script src="https://ampcode.com/w/pw_….js" async></script>

Widgets that you enabled before November 13, 2026 in a workspace project have a key that starts with client_. Their script tags keep working.

The site needs nothing else. It does not need server code or its own sign-in, and the script does not contain the project name.

If your site sends a Content-Security-Policy header, allow https://ampcode.com in script-src and in frame-src. The widget loads from that address, and it shows the Amp panel in a frame.

Allowed Origins

The widget works only on the origins in this list. An origin is the scheme, host, and port of a site, e.g., https://www.example.com. Amp keeps only the origin of the address you enter, so https://www.example.com/pricing adds https://www.example.com.

  • An origin must use https://. For local development, http://localhost, http://127.0.0.1, and http://[::1] with any port are also allowed.
  • Add each site separately, e.g., your production site and your staging site. For many sites under one domain, use a wildcard origin.
  • On a site that is not in the list, the Amp panel does not open. Amp also refuses comments made on pages that are not in the list.
  • Do not add portal addresses. On a portal page, the portal’s own review widget replaces the feedback widget and sends comments to the portal’s thread.

Each origin in the list has a button that opens the site with ?amp, so you can check the widget right away. Wildcard origins do not have this button. Click the remove button next to an origin to remove it.

Wildcard Origins

A wildcard origin allows every site that has one label in place of the *. Use it for sites that get a new host name each time, e.g., preview environments. For example, https://*.previews.example.com allows:

  • https://pr-123.previews.example.com
  • https://a1b2c3.previews.example.com

It does not allow:

  • https://previews.example.com, because nothing is in place of the *.
  • https://a.b.previews.example.com, because the * stands for exactly one label.
  • http://pr-123.previews.example.com, because the scheme is not https://.
  • https://pr-123.previews.example.com:8443, because the port is different. To allow a port, put it in the wildcard origin, e.g., https://*.previews.example.com:8443.

Amp refuses a wildcard origin that can match sites that other people own:

  • A wildcard origin must use https://.
  • The * must be the whole first label, and the origin can have only one *. Amp refuses https://*, https://pr-*.example.com, and https://*.*.example.com.
  • The host must have at least three labels, so the * stands for a third-level label or lower. https://*.example.com is allowed, and https://*.com is not.
  • The part after *. must be a domain that someone can own, not a public suffix. Amp refuses https://*.co.uk and https://*.github.io, because each of them covers sites of many owners. Amp uses the Public Suffix List to find public suffixes.
  • Amp refuses wildcard origins under the domains where Amp itself serves sites, e.g., https://*.onamp.dev. You can still add one exact origin there, e.g., the origin of your Box app.
  • Amp refuses a wildcard origin over an active custom domain from a Domains settings page, e.g., https://*.portal.example.com when portal.example.com is a custom domain for portals. Amp serves the portals of orbs on the subdomains of that domain. You can still add the exact origin of one portal.

A wildcard origin gives each matching site the same access as an exact origin. Add one only for a domain where your team controls every site.

Send Feedback

  1. Open a page of your site with ?amp at the end of the address, e.g., https://www.example.com/pricing?amp. The widget button appears in a corner of the page.

  2. Click the widget button, then click an element on the page. Write what you want changed and click Add, or press Enter.

  3. To comment on more elements, click New Comment. Your comments can be on different pages of the same site, and the widget keeps them until you send them.

  4. Click Send. The Amp panel opens on the page.

  5. The first time, click Continue with Amp. A window opens. Sign in to Amp if you are not signed in, and click Connect. After 12 hours, click Continue with Amp again.

  6. Check your comments and click Start in an orb.

Amp starts a new thread in the project and titles it from your comments, as it titles any new thread. Click Open Thread to follow it in Amp. The thread is yours, as if you had started it in Amp. The agent gets each comment with the selected element and the address of its page. It works in an orb with a copy of the repository, not on the live site, so ship the change from the thread as usual. See Shipping Changes.

Show or Hide the Widget

The widget is hidden until someone opens a page of the site with ?amp. After that, the browser remembers the choice for that site, and the widget shows on every page without ?amp.

  • To hide the widget, press Cmd+. on macOS or Ctrl+. on other systems. You can also right-click the widget button, or touch and hold it, and choose Hide Review Button.
  • To show it again, press the same keys, or open a page with ?amp. On a touch device, tap three times quickly where the button was.

The script loads for every visitor of the site. The widget stays hidden for them, but anyone who presses the keys can show the button. Only people who can start threads in the project can send comments. If you do not want the script on your public site, add it only to your staging site.

Permissions

  • Set up and change the widget. Enabling the widget, changing the allowed origins, and turning it off take the same permission as changing the project’s settings: the project’s creator or a workspace admin.
  • Send comments. Anyone who can start threads in the project can send comments. In a workspace project, that is every member of the workspace. In a personal project, that is only you. Other people who try to connect see Access Required, and they cannot send.

A connection lasts 12 hours. Access ends earlier when:

  • The person leaves the project’s workspace. The widget stops working for them at once.
  • An editor turns the widget off. To end everyone’s access at once and keep the widget, click Turn Off, then Enable, and replace the script tag on your site.

Site Security

Comments from the widget start threads in the project in the name of the project member who sends them. The agent in those threads can use the project’s repository and secrets. If an attacker gets control of your site, they can add hidden instructions to the comments that members send.

The Feedback Widget tab shows this as the Widget Security notice. When you turn the widget on with the CLI or ask Amp to do it, you get the same notice after the widget is on.

  • Add the script tag only to sites that you control and keep up to date.
  • If you think that an attacker got control of your site, click Turn Off on the Feedback Widget tab.

Turn Off the Widget

To take the widget off one site, remove the script tag from that site.

To turn the widget off for the whole project, click Turn Off on the Feedback Widget tab. Amp deletes the project’s widget key:

  • The script tag stops loading the widget on every site.
  • Everyone who connected loses access, and nobody can send comments from the widget.
  • The allowed origins stay in the list.

If you click Enable again later, Amp creates a new widget key. Replace the old script tag on your site with the new one.

Use the CLI or Ask Amp

You can do most of the same steps with the Amp CLI. Each command takes the project ID or its namespace/name, and needs the same permission as the Feedback Widget tab. To add an allowed origin, use the Feedback Widget tab or ask Amp.

amp projects feedback-widget get acme/website
amp projects feedback-widget enable acme/website
amp projects feedback-widget remove-origin acme/website https://www.example.com
amp projects feedback-widget disable acme/website --yes

Put a wildcard origin in quotes, so that your shell does not expand the *.

You can also ask Amp, e.g., “Turn on the feedback widget for acme/website and give me the script tag.” Before Amp adds an allowed origin, it asks you to approve the origin in a dialog. Before it turns the widget off, it asks you to confirm.

Limits

  • By default, each send starts a new thread. With Feedback Widget Destinations on in Experimental Features, you can send to one of your recent threads or a Space of the project instead.
  • The agent works in an orb, not on the live site, so it cannot see the live site’s data.
  • You add allowed origins by hand.
  • The Amp panel opens only when every page around it is on an allowed origin. If another site shows your site in a frame, the panel does not open there.