A web widget and a relay for page feedback: capture the page, mark it up or click a point and comment, and get a GitHub issue or a review kept on your own disk.
- Artifact's hosted relay. The Cloudflare Worker at
https://feedback.artifact.comfiles every report as a GitHub issue in the product's repo as soon as it arrives. Its products open on review mode: tap to comment on a point, drag to comment on a region, and one submission files one issue. Any relay deployed from this repo works the same way;ORG_DEFAULTS.<owner>.reviewMode: "markup"opts that owner's repos into the classic drawing sheet instead. - Local.
npm run review:localkeeps pin reviews on disk under.feedback/reviews. Nothing reaches GitHub until you promote a thread with Create GitHub issue, which appears when the server was started with--github OWNER/REPO.
A report lives in one of those two places. The widget's mode attribute changes only which tool the sheet opens on, never where a report goes.
From a feedback checkout with Node 22 or newer:
npm ci
npm run review:localOpen http://127.0.0.1:5184 to resume your latest visual review. Click a spot to leave a pin or click a numbered pin to open its thread. All reviews opens the library at /reviews, where Pin this page starts the widget and Review an image opens a PNG or JPEG for annotation. Embed the widget in the app you want to review to pin that app's current view. The server keeps the screenshot and discussion under .feedback/reviews. Restart with the same directory to resume. Use --data-dir for a different location.
To create GitHub issues from selected threads, or open an existing GitHub review on your computer, sign in with the GitHub CLI and start the server with a repository:
npm run review:local -- --github YOUR-OWNER/YOUR-REPO --product demoCaptures still save to disk; Create GitHub issue promotes one thread, its replies, its resolution state and the screenshot. Promoting the general discussion copies the report and its general replies. In the original local review, the promoted conversation shows a link to its GitHub issue. Its screenshot marker stays in place, and the other threads remain open for discussion locally. The server uses the active gh login only for the configured repository. If port 5184 is taken, pass --port 5185 --origin http://127.0.0.1:5184. The loopback server is for the person using that machine.
Run npm run review:local and open All reviews. Both buttons capture the same page, and neither needs GitHub or Cloudflare credentials.
| Try | What to look for |
|---|---|
| Try classic markup | Draw a box or redact part of the screenshot, enter a message, and save. The drawing is baked into the saved image. |
| Pin this page | Click a spot and write a comment, or drag across an area to comment on it; click a numbered comment to revise or remove it. Add anything about the whole screen in the message field, and choose Save review. Click the numbered pin in the saved review to reply or resolve it. Refresh, select Show resolved points, and reopen it. |
| Restart the server | Stop and restart it with the same data directory. The review opens the same pixels, positions, replies and resolution states. |
With a screenshot, the sheet opens on the comment tool:
- Tap or click a spot to place a numbered dot and write its comment. Drag across an area to comment on that region instead. Enter saves; Shift+Enter starts a new line; Escape discards a comment you just placed.
- Tap a dot, badge or region to revise its comment or Remove it. The rest renumber. An empty comment is dropped when its editor closes.
- The editor starts with a whole-screen message. Placing a point or region moves the draft text to that location. Save keeps the pin in the report. You can then add another pin or a separate whole-screen message before Save review sends the report.
- Draw holds Pen, Box and Redact. Drawings and redactions are burned into the uploaded screenshot; comments are sent as data (up to 20, 3,000 characters in total) and appear in the issue and the viewer.
- Keyboard: focus the screenshot, move the cursor with the arrow keys (Shift for bigger steps) and press Enter to comment there. The list of comments has an Edit button for each.
On narrow screens the sheet fills the viewport with the screenshot above the panel, and the screenshot shrinks while a comment is open so the editor stays above the on-screen keyboard.
npm run demo serves a sample app page at http://127.0.0.1:5185/?open with the sheet open on it, backed by a local review server on port 5184 that keeps reports in a temporary directory. Add &markup to open on the drawing tools. Saving opens the review in the local viewer. Nothing in the demo is part of the Worker.
Use <feedback-studio> when reviewers should save comments as they go, leave review to use the app, and choose later which comments become GitHub issues. The existing <feedback-widget> sends a complete report with the delivery behavior described above.
Try both on the same page with Node 22.13+ and npm ci && npm run demo. Open the persistent workspace and the report sheet. The demo uses a temporary directory for this run.
- Type a whole-screen comment. Click a point, drag a region or draw to attach the draft to the page. Click Save once.
- Exit feedback, use the app, then open feedback again. Reopen the saved comment, or expand All outstanding feedback to find comments from other pages. Desktop/phone and light/dark switches are available when the host implements them.
- Choose Turn feedback into issues. Select comments, choose one issue or a separate issue for each, and save a draft. GitHub publication requires a configured repo. Converted comments leave the outstanding list. Each issue links to the original page and its saved capture.
For a local relay, run the following from this repo. Substitute the exact origin of your dev server. Omit --github for a review that saves to disk without GitHub publication.
npm run review:local -- --origin http://127.0.0.1:5173 --product web --iteration release-1 --github OWNER/REPOLoad the module in the app you want to review and use your own feedback button. The workspace captures the actual host page. It does not add a launcher to the app.
<button id="review-page">Feedback</button>
<feedback-studio local product="web" relay="http://127.0.0.1:5184"></feedback-studio>
<script type="module">
import "http://127.0.0.1:5184/v1/studio.js";
const studio = document.querySelector("feedback-studio");
document.querySelector("#review-page").onclick = () => studio.open();
</script>The relay scopes notes, captures, and drafts by product and application origin. Keep the same data directory and iteration ID across restarts. Change the operator-configured iteration ID when the UI changes enough to start a fresh round. Links with ?feedback-note=… replay previous iterations. An app that can switch its own device layout or theme can expose studio.getView() and studio.setView(view) before opening review. Return { route, device, theme } with an app-relative route, desktop or phone, and light or dark. For routes selected by query parameters, also return an entry such as /projects?tab=active containing the app state needed to reopen the page. Resolve setView after the app has rendered. Canvas apps may supply studio.capture() returning a PNG or JPEG Blob. The demo shows a host adapter.
- Add
"workspaceIteration": "release-1"to the relevantvars.PRODUCTSentry alongside its repo and allowed origins. Generate and deploy the config using the Worker setup guide. The release includes the SQLite Durable Object binding and migration. - On the app, load
https://YOUR-RELAY/v1/studio.js, set the element'srelayto that HTTPS origin, and omitlocal. Reviewers sign in through the relay’s GitHub OAuth app. The Worker checks the viewer’s write access to the configured repository on each workspace request, including screenshot reads. Publication uses the signed-in reviewer's credentials. - For immediate filing on save, set
"autoCreateIssues": truein the product or its lowercase owner entry underORG_DEFAULTS. A product value overrides the owner value. With automatic filing enabled, the button reads Save and create GitHub issue. If publication fails, the saved comment and draft can be recovered with Retry filing. With manual filing, reviewers explicitly group and publish their saved comments. The original report sheet keeps its existing delivery settings.
Workspace issues link back to the captured page. Continue the conversation on the linked GitHub issue after publication. The hosted workspace retains original captures and previous iterations in the operator's Cloudflare account. Local workspaces retain them in the local data directory. Issue links reopen those captures through the configured app and relay, so both must be available for playback.
One relay can serve several product repositories. Its operator sets vars.PRODUCTS in the deployment's Wrangler config. Each product app loads the widget from that relay and supplies its product ID:
<script type="module" src="https://feedback.example.com/v1/feedback.js"></script>
<feedback-widget product="web"></feedback-widget>An operator can keep a non-secret deployment manifest in the consuming project or in a separate infrastructure repo. It names the Worker and domain and maps product IDs to GitHub repos and allowed browser origins:
{
"worker": "product-feedback",
"hostname": "review.example.com",
"vars": {
"GITHUB_OAUTH_CLIENT_ID": "<your-oauth-client-id>",
"PRODUCTS": {
"web": { "repo": "example-owner/web-app", "origins": ["https://app.example.com"] }
}
}
}npm run config:generate -- <manifest.json> <output.json> adds this release's entry point, Durable Object binding and migrations. Set FEEDBACK_CONFIG to the generated file for npm run dev, npm run deploy and npm run health. The deployment guide covers credentials, domain checks, CI and verification.
reviewMode is "pins" or "markup". It is resolved per product, then from vars.ORG_DEFAULTS.<owner> (the lowercase owner of the product's owner/repo), then the built-in default "pins". GET /v1/settings?product=web returns the resolved value. A widget's mode="pins" or mode="markup" overrides only the tool it opens on.
webReview is true or false and resolves the same way, with the built-in default true. With it off, a pin review is still one issue with its numbered comments, their positions and the screenshot, but the issue carries no viewer record and gets no link comment, the report's response has no review link, and /review and /v1/review answer 404 web_review_off for that product. Comments and triage then happen on GitHub. Artifact's relay sets ORG_DEFAULTS.arfct.webReview: false.
assignee is a GitHub login and resolves the same way, with no built-in default. When it is set, a sender who is signed in and can push to the product's repo can long-press Send (right-click on a desktop, or the context-menu key) to open a menu with Send and Send and assign to @login. The second sends assign=1, and the relay files the issue with the sender's token and that assignee. It never assigns with the relay's own token, so an anonymous sender or one without push access gets 403 and nothing is filed. The receipt carries assignee and assigned; assigned is false when GitHub filed the issue but dropped an assignee it can't assign in that repo. Artifact's relay sets ORG_DEFAULTS.arfct.assignee: "artifact-agent", so Send and assign hands the issue to the issue agent.
A capture sent from the standard sheet to a hosted relay becomes one issue: the general message, then every comment numbered with its position (1. **p1** (25%, 70%): … for a point, 2. **p2** (region 10%, 20%, 30% × 40%): … for an area), the screenshot, and a review record that keeps each comment's normalized x, y and, for a region, w and h. Without a general message, the first comment titles the issue. /review?product=…&issue=… opens it in the viewer, and the issue gets a comment linking there and to the local equivalent, unless the product has web review off. Every read and write in the viewer uses the viewer's own GitHub sign-in; the relay's filing token never grants access to a review or its image. To reply to a point from GitHub, start a comment with @pin p1 on its own line, using the point's ID. Ordinary comments appear as general discussion.
- A sender signed in with GitHub who can push to the repo: the relay files the issue with the sender's own token, so the sender is its author.
- A signed-in sender who can't push: the relay's machine account files it, and the body reads
From @login. The mention is how the sender hears about replies. - Nobody signed in: the machine account files it, and the body reads "From an anonymous sender". These senders get no replies, and the sheet tells them so.
When the machine account files an issue, @mentions in the message are broken with a zero-width space, so a report can't notify people on a sender's behalf.
After a report is filed, the sheet links its issue by title, whoever sent it, and a close box dismisses it. On a private repo, a sender who can't read the repo gets GitHub's 404 page from that link.
Each screenshot from the standard capture sheet goes first to GitHub's attachment store, the one pasting into an issue uses; on a private repo only people who can read the repo can see it. That endpoint is undocumented. If it fails, the image is committed to a feedback-assets branch, which needs Contents write. If both fail, the issue is still filed and says "The screenshot couldn't be stored." Promotions from the local server use the same order; one whose screenshot can't be stored stops with an error and can be retried.
A pin review's record names the attachment URL and the SHA-256 of the uploaded bytes, or the commit and path on feedback-assets. The viewer fetches an attachment with the viewer's token, follows GitHub's redirect to its signed asset host without the token, and refuses bytes that don't match the hash.
| Endpoint | Purpose |
|---|---|
GET /v1/settings?product=… |
Returns the resolved reviewMode, webReview and, when set, assignee. |
POST /v1/reports |
Files an issue. Multipart product, message (up to 5000 characters), optional image (PNG/JPEG, up to 10 MB) and JSON meta. review=1 with JSON pins files a pin review and requires an image: up to 20 comments, each {x,y,text} for a point or {x,y,w,h,text} for a region, normalized to 0–1 and inside the image, with 3,000 characters in total. The message may be empty only when there is at least one comment. An optional Authorization: token <t> identifies the sender. |
GET /review |
Review viewer. product and issue for a GitHub review; local on the disk server. |
GET /v1/review, GET /v1/review/image |
The discussion and original screenshot of a GitHub review. |
POST /v1/review/events |
Adds a comment or point, replies, or changes a point's status. |
POST /v1/auth/device, POST /v1/auth/device/poll |
Starts native sign-in and polls the device grant. |
GET /v1/auth/start, GET /auth/callback, GET /v1/whoami |
Web OAuth and sender identification. |
GET /v1/feedback.js, GET /v1/health |
Bundled web component and deployment health. |
A filed report answers 201 { issue, number, title, as, screenshot }, where title is the issue's title. as is "sender" or "relay"; clients that matched the earlier "artifact-feedback" role should accept "relay". screenshot is "attachment", "branch", "missing" or "none". A pin review adds review and reviewLinked. If GitHub refuses the issue, the relay answers 502 github_failed. The disk server answers with as: "local".
The meta keys kept are version, build, platform, osVersion, device, userAgent, locale, route and uptime (in seconds). Every other key is dropped. The kept values go into a Details table in the issue, as code spans.
The Origin header is checked when a request has one, which browsers always send. Native apps send none. Each address can send 10 reports per 10 minutes, counted by a Durable Object, because Workers Rate Limiting only offers 10- and 60-second periods.
Logs record the product, the outcome, the issue number, how the image was stored, and who filed the issue. They never record tokens, messages or images.
The web sheet's source is client/feedback.js, with types in client/feedback.d.ts. The relay serves it at GET /v1/feedback.js, bundled with modern-screenshot and pointed at the relay it was loaded from:
<script type="module" src="https://review.example.com/v1/feedback.js"></script>
<feedback-widget product="your-product"></feedback-widget>
<button onclick="document.querySelector('feedback-widget').open()">Review this page</button><artifact-feedback> remains a compatibility alias for <feedback-widget>. A copied and bundled widget must set relay explicitly. Signed-in browser keys are scoped per relay, so existing users sign in again after upgrading. The older review attribute requests pins when mode is absent. For the disk server, use <feedback-widget local relay="http://127.0.0.1:5184"> and start the server with --origin for the embedding app.
The site's origin and repo have to be in the relay's PRODUCTS first. An app with a bundler can copy client/feedback.js, client/page-theme.js, and client/feedback.d.ts together and install modern-screenshot.
Register the GitHub repository and its browser origins in the relay's vars.PRODUCTS. A trailing :* matches any port on a development origin. Give the relay's filing token access to the repo. Sharing an existing relay also shares its Cloudflare account and GitHub OAuth app; web sign-in requests GitHub's repo scope.
vars.PRODUCTS is part of the deployed config, so when the config lives in a public repo, every origin in it is public. Any product can keep some of its origins out of the config, such as a staging, VPN or tailnet hostname, by listing them in the optional Worker secret EXTRA_ORIGINS. Its value is a JSON object that maps product IDs to extra origins:
{
"web": ["https://staging.internal.example"],
"board": ["https://board.tailnet.example"]
}- Register the product in
vars.PRODUCTSwith its repo and any origins that can be public. The secret only adds origins to products that are already registered. - Add the product's private origins to the JSON value in your secret store. One secret holds the private origins of every product, and Cloudflare can't read a secret back, so the secret store keeps the full value.
- Set the secret on the Worker with the whole value:
npx wrangler secret put EXTRA_ORIGINS --name <worker>, then paste the JSON at the prompt. Wrangler deploys a new version with the secret. For a first deployment, include it in the secrets file instead (see the deployment guide). - Check that a preflight from the new origin is allowed and one from an unlisted origin is refused:
for origin in https://board.tailnet.example https://unlisted.example; do
curl -s -o /dev/null -w "$origin %{http_code}\n" -X OPTIONS "https://<relay-host>/v1/health" \
-H "Origin: $origin" -H 'Access-Control-Request-Method: POST'
doneThe first returns 204 and the second 403. Extra origins match like origins in PRODUCTS, including a trailing :*. Origins listed for an unregistered product are ignored, and a value that isn't a JSON object adds no origins. Without the secret, the relay uses PRODUCTS alone.
apple/FeedbackKit is the native iOS version of the sheet, as a Swift package. It captures the app's window, lets testers comment and draw on it, and files the report through the same relay. apple/FeedbackDemo is a sample app. See apple/README.md for how to add it to an app, its API, the demo's debug hooks and its tests.
android/ is the native Android version: the same sheet in Compose and Material 3, the same relay calls and the same fixture rules. A screenshot opens it on Android 14 and up, and apps open it from their own controls with Feedback.present() or a FeedbackButton row. android/demo is a sample app. See android/README.md for how to add it to an app, its API, the demo's debug hooks and its tests.
src/: the Cloudflare Worker relay.client/: the web widget, bundled intosrc/generated/bynpm run build.test/: Vitest, run in the Workers runtime.scripts/: tooling, includingreview-local.mjs, the local review server.fixtures/: golden JSON vectors for the relay's rules (meta, pins, titles, reports). The Worker's tests (test/fixtures.test.ts) and FeedbackKit's tests on iOS and Android assert them, so the web relay and native clients stay in step.apple/FeedbackKit/: the iOS Swift package.swift testruns its tests.Package.swift: exposes FeedbackKit at the repo root so apps can depend on this repo by git URL.apple/FeedbackDemo/: the iOS sample app. XcodeGen generates its project fromproject.yml; the.xcodeprojisn't committed.android/: the Android Gradle build:core(pure Kotlin, with the fixture tests),feedbackkit(the library) anddemo(the sample app).
npm ci
npm test
npm run typecheck
npm run lint
(cd apple/FeedbackKit && swift test) # on a Mac with Xcode 27
(cd android && ./gradlew :core:test) # with JDK 21 and the Android SDKThe tests run in the Workers runtime through @cloudflare/vitest-pool-workers, with all outbound network stubbed (test/setup.ts and test/fetch-router.ts). npm run build bundles client/ into src/generated/, which git ignores; dev, test, typecheck and deploy run it first.
To run the relay against GitHub, copy .dev.vars.example to .dev.vars, which git ignores, fill in the secrets from your secret store, and run npm run dev.
Use the deployment guide for an independent relay. The checked-in deployment uses an admin-dispatched CI workflow on main: the deploy job checks the actor against DEPLOY_ADMINS, waits for the code checks and verifies the Worker's health. Pull requests run tests only.